Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ public XmlElementTester(XmlDocument doc, string path)

public XmlElementTester ShouldExist()
{
if (currentElement == null)
if (currentElement is null)
throw new SpecificationException(string.Format("Should exist at {0} but does not.", currentPath));

return this;
}

public XmlElementTester ShouldNotExist()
{
if (currentElement != null)
if (currentElement is not null)
throw new SpecificationException(string.Format("Should not exist at {0} but does.", currentPath));

return this;
Expand Down
6 changes: 3 additions & 3 deletions src/FluentNHibernate.Testing/AutoMapping/TestFixtures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public System.Type ReturnedClass
public new bool Equals(object x, object y)
{
if (x == y) return true;
if (x == null || y == null) return false;
if (x is null || y is null) return false;

DoubleString lhs = (DoubleString)x;
DoubleString rhs = (DoubleString)y;
Expand All @@ -349,7 +349,7 @@ public int GetHashCode(object x)

public Object DeepCopy(Object x)
{
if (x == null) return null;
if (x is null) return null;
DoubleString result = new DoubleString();
DoubleString input = (DoubleString)x;
result.s1 = input.s1;
Expand All @@ -367,7 +367,7 @@ public object NullSafeGet(DbDataReader dr, string[] names, ISessionImplementor s
string first = (string)NHibernateUtil.String.NullSafeGet(dr, names[0], session, owner);
string second = (string)NHibernateUtil.String.NullSafeGet(dr, names[1], session, owner);

return (first == null && second == null) ? null : new string[] { first, second };
return (first is null && second is null) ? null : new string[] { first, second };
}

public void NullSafeSet(DbCommand cmd, object value, int index, bool[] settable, ISessionImplementor session)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void SetUp()

public string ValueOf(string key)
{
if( _nhibConfig == null )
if( _nhibConfig is null )
{
_nhibConfig = new Configuration();
_config.ConfigureProperties(_nhibConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleParentClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleParentClass)) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ private void VerifyModel(Action<ClassMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First();

modelVerification(modelInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void VerifyModel(Action<ComponentMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = (ComponentMapping)generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(PropertyTarget)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(PropertyTarget)) is not null)
.Classes.First()
.Components.First(x => x is ComponentMapping);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ private void VerifyModel(Action<CompositeIdMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ private void VerifyModel(Action<ComponentMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = (ComponentMapping)generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(PropertyTarget)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(PropertyTarget)) is not null)
.Classes.First()
.Components.First(x => x is ComponentMapping);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleInheritedClass)) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ private void VerifyModel(Action<OneToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.OneToOnes.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void VerifyModel(Action<HibernateMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null);
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null);

modelVerification(modelInstance);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ private void VerifyModel(Action<IdMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ private void VerifyModel(Action<JoinMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Joins.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private void VerifyModel(Action<SubclassMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Subclasses.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ private void VerifyModel(Action<KeyManyToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ private void VerifyModel(Action<KeyPropertyMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ private void VerifyModel(Action<ManyToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.References.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void VerifyModel(Action<PropertyMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Properties.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ private void VerifyModel(Action<SubclassMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Subclasses.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void VerifyModel(Action<VersionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ValidVersionClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ValidVersionClass)) is not null)
.Classes.First()
.Version;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private class TestForeignKeyConvention : ForeignKeyConvention
{
protected override string GetKeyName(Member property, Type type)
{
return property == null ? type.Name + "!" : property.Name + "!";
return property is null ? type.Name + "!" : property.Name + "!";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ private void VerifyModel(Action<ClassMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First();

modelVerification(modelInstance);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ private void VerifyModel(Action<ComponentMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = (ComponentMapping)generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Components.First(x => x is ComponentMapping);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ private void VerifyModel(Action<CompositeIdMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void VerifyModel(Action<ComponentMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = (ComponentMapping)generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Components.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ private void VerifyModel(Action<CollectionMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Collections.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ private void VerifyModel(Action<OneToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.OneToOnes.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void VerifyModel(Action<HibernateMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null);
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null);

modelVerification(modelInstance);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ private void VerifyModel(Action<IdMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ private void VerifyModel(Action<JoinMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Joins.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ private void VerifyModel(Action<SubclassMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.Subclasses.First();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ private void VerifyModel(Action<KeyManyToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private void VerifyModel(Action<KeyPropertyMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == typeof(ExampleClass)) is not null)
.Classes.First()
.Id;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ private void VerifyModel(Action<ManyToOneMapping> modelVerification)

var generatedModels = model.BuildMappings();
var modelInstance = generatedModels
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) != null)
.First(x => x.Classes.FirstOrDefault(c => c.Type == mappingType) is not null)
.Classes.First()
.References.First();

Expand Down
Loading