public void PropertyMapping_ByteArray_MapsAsNullable() { //act var mapping = new PropertyMappingTestClass(typeof(byte[]), "prop", "prop"); //assert mapping.IsNullable.Should().Be.True(); }
public void PropertyMapping_Guid_MapsAsNotNullable() { //act var mapping = new PropertyMappingTestClass(typeof(Guid), "prop", "prop"); //assert mapping.IsNullable.Should().Be.False(); }
public void PropertyMapping_String_MapsCorrectly() { //act var mapping = new PropertyMappingTestClass(typeof(string), "prop", "att"); //assert mapping.AttributeName.Should().Be.EqualTo("att"); mapping.PropertyName.Should().Be.Equals("prop"); mapping.PropertyType.Should().Be.EqualTo(typeof(string)); mapping.IsNullable.Should().Be.True(); }
public void Default_ObjectType_ReturnsNull() { //prepare var mapping = new PropertyMappingTestClass(typeof(string[]), "prop", "prop"); //act var value = mapping.Default(); //assert value.Should().Be.Null(); }
public void Default_ValueType_ReturnsDefault() { //prepare var mapping = new PropertyMappingTestClass(typeof(DateTime), "prop", "prop"); //act var value = mapping.Default(); //assert value.Should().Be.EqualTo(default(DateTime)); }
public void Default_NullableValueType_ReturnsNull() { //prepare var mapping = new PropertyMappingTestClass(typeof(DateTime?), "prop", "prop"); //act var value = mapping.Default(); //assert value.Should().Be.Null(); }
public void Default_ObjectType_SetsDefaultMethod() { //prepare var mapping = new PropertyMappingTestClass(typeof(string[]), "prop", "prop"); var mapping2 = new PropertyMappingTestClass(typeof(string[]), "prop2", "prop2"); //act var value = mapping.Default(); var value2 = mapping2.Default(); //assert value.Should().Be.Null(); value2.Should().Be.Null(); }