예제 #1
0
        public void PropertyMapping_ByteArray_MapsAsNullable()
        {
            //act
            var mapping = new PropertyMappingTestClass(typeof(byte[]), "prop", "prop");

            //assert
            mapping.IsNullable.Should().Be.True();
        }
예제 #2
0
        public void PropertyMapping_Guid_MapsAsNotNullable()
        {
            //act
            var mapping = new PropertyMappingTestClass(typeof(Guid), "prop", "prop");

            //assert
            mapping.IsNullable.Should().Be.False();
        }
예제 #3
0
        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();
        }
예제 #4
0
        public void Default_ObjectType_ReturnsNull()
        {
            //prepare
            var mapping = new PropertyMappingTestClass(typeof(string[]), "prop", "prop");

            //act
            var value = mapping.Default();

            //assert
            value.Should().Be.Null();
        }
예제 #5
0
        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));
        }
예제 #6
0
        public void Default_NullableValueType_ReturnsNull()
        {
            //prepare
            var mapping = new PropertyMappingTestClass(typeof(DateTime?), "prop", "prop");

            //act
            var value = mapping.Default();

            //assert
            value.Should().Be.Null();
        }
예제 #7
0
        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();
        }