public void ThrowExceptionOnPropertyTypeHandlerMapperViaExpressionThatIsAlreadyExisting()
        {
            // Setup
            var stringPropertyHandler = new StringPropertyHandler();
            var textPropertyHandler   = new TextPropertyHandler();

            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, StringPropertyHandler>(e => e.ColumnString, stringPropertyHandler);
            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, TextPropertyHandler>(e => e.ColumnString, textPropertyHandler);
        }
        public void ThrowExceptionOnPropertyTypeHandlerMapperViaFieldThatIsAlreadyExisting()
        {
            // Setup
            var stringPropertyHandler = new StringPropertyHandler();
            var textPropertyHandler   = new TextPropertyHandler();
            var field = new Field("ColumnString");

            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, StringPropertyHandler>(field, stringPropertyHandler);
            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, TextPropertyHandler>(field, textPropertyHandler);
        }
        public void ThrowExceptionOnPropertyTypeHandlerMapperViaPropertyNameThatIsAlreadyExisting()
        {
            // Setup
            var stringPropertyHandler = new StringPropertyHandler();
            var textPropertyHandler   = new TextPropertyHandler();
            var propertyName          = "ColumnString";

            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, StringPropertyHandler>(propertyName, stringPropertyHandler);
            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, TextPropertyHandler>(propertyName, textPropertyHandler);
        }
        public void TestPropertyHandlerMapperPropertyMappingViaExpressionOverride()
        {
            // Setup
            var stringPropertyHandler = new StringPropertyHandler();
            var textPropertyHandler   = new TextPropertyHandler();

            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, StringPropertyHandler>(e => e.ColumnString, stringPropertyHandler);
            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, TextPropertyHandler>(e => e.ColumnString, textPropertyHandler, true);

            // Act
            var actual   = PropertyHandlerMapper.Get <PropertyHandlerMapperTestClass, object>(e => e.ColumnString);
            var expected = (actual is TextPropertyHandler);

            // Assert
            Assert.IsTrue(expected);
        }
        public void TestPropertyHandlerMapperPropertyMappingViaFieldOverride()
        {
            // Setup
            var stringPropertyHandler = new StringPropertyHandler();
            var textPropertyHandler   = new TextPropertyHandler();
            var field = new Field("ColumnString");

            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, StringPropertyHandler>(field, stringPropertyHandler);
            PropertyHandlerMapper.Add <PropertyHandlerMapperTestClass, TextPropertyHandler>(field, textPropertyHandler, true);

            // Act
            var actual   = PropertyHandlerMapper.Get <PropertyHandlerMapperTestClass, object>(field);
            var expected = (actual is TextPropertyHandler);

            // Assert
            Assert.IsTrue(expected);
        }