public void WhenCustomizeThenCallCustomizerGeneric()
        {
            var mapdoc       = new HbmMapping();
            var component    = new HbmDynamicComponent();
            var mapper       = new DynamicComponentMapper(component, For <PersonWithGenericInfo> .Property(p => p.Info), mapdoc);
            var propertyInfo = For <PersonWithGenericInfo> .Property(p => p.Info);          //just as another dyn-compo

            var called = false;

            mapper.Component(propertyInfo, (IDynamicComponentMapper x) => called = true);

            Assert.That(called, Is.True);
        }
Beispiel #2
0
        public void WhenCustomizeThenCallCustomizer()
        {
            var mapdoc       = new HbmMapping();
            var component    = new HbmDynamicComponent();
            var mapper       = new DynamicComponentMapper(component, For <Person> .Property(p => p.Info), mapdoc);
            var propertyInfo = (new { A = (object)null }).GetType().GetProperty("A");

            var called = false;

            mapper.Any(propertyInfo, typeof(int), x => called = true);

            Assert.That(called, Is.True);
        }
Beispiel #3
0
        public void WhenCustomizeThenCallCustomizer()
        {
            var mapdoc       = new HbmMapping();
            var component    = new HbmDynamicComponent();
            var mapper       = new DynamicComponentMapper(component, For <Person> .Property(p => p.Info), mapdoc);
            var propertyInfo = (new { A = (IEnumerable <int>)null }).GetType().GetProperty("A");

            var called = false;

            mapper.Bag(propertyInfo, x => called = true, rel => { });

            Assert.That(called, Is.True);
        }
        public void WhenCustomizeThenCallCustomizer()
        {
            var mapdoc       = new HbmMapping();
            var component    = new HbmDynamicComponent();
            var mapper       = new DynamicComponentMapper(component, For <Person> .Property(p => p.Info), mapdoc);
            var propertyInfo = (new { A = (IDictionary <int, int>)null }).GetType().GetProperty("A");

            var called = false;

            mapper.Map(propertyInfo, x => called = true, km => { }, rel => { });

            called.Should().Be.True();
        }
Beispiel #5
0
        public void WhenCustomizeThenCallCustomizerGeneric()
        {
            var mapdoc       = new HbmMapping();
            var component    = new HbmDynamicComponent();
            var mapper       = new DynamicComponentMapper(component, For <PersonWithGenericInfo> .Property(p => p.Info), mapdoc);
            var propertyInfo = (new { A = (MyClass)null }).GetType().GetProperty("A");

            var called = false;

            mapper.Component(propertyInfo, (IComponentMapper x) => called = true);

            Assert.That(called, Is.True);
        }