public void AddDynamicComponentPropertyGeneric()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <MyClassWithDynamicGeneric>(properties);

            map.Component(For <MyClassWithDynamicGeneric> .Property(x => x.DynCompo), (IDynamicComponentMapper cp) => { });
            Assert.That(properties.Single(), Is.TypeOf <HbmDynamicComponent>().And.Property("Name").EqualTo("DynCompo"));
        }
        public void AddDynamicComponentProperty()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <MyClassWithDynamic>(properties);

            map.Component(For <MyClassWithDynamic> .Property(x => x.DynCompo), (IDynamicComponentMapper cp) => { });
            properties.Single().Should().Be.OfType <HbmDynamicComponent>().And.ValueOf.Name.Should().Be.EqualTo("DynCompo");
        }
        public void CallDynamicComponentMapperGeneric()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <MyClassWithDynamicGeneric>(properties);
            var called     = false;

            map.Component(For <MyClassWithDynamicGeneric> .Property(x => x.DynCompo), (IDynamicComponentMapper cp) => called = true);
            Assert.That(called, Is.True);
        }
        public void CallDynamicComponentMapper()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <MyClassWithDynamic>(properties);
            var called     = false;

            map.Component(For <MyClassWithDynamic> .Property(x => x.DynCompo), (IDynamicComponentMapper cp) => called = true);
            called.Should().Be.True();
        }
Esempio n. 5
0
        public void CanAddComponentProperty()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <Zoo>(properties);

            map.Component(zoo => zoo.Address, comp => { });

            properties.Should().Have.Count.EqualTo(1);
            properties.First().Should().Be.OfType <HbmComponent>().And.ValueOf.Name.Should().Be.EqualTo("Address");
        }
Esempio n. 6
0
        public void CanAddComponentPropertyAndItsProperties()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <Zoo>(properties);

            map.Component(zoo => zoo.Address, comp =>
            {
                comp.Property(address => address.City);
                comp.Property(address => address.PostalCode);
            });

            properties.Should().Have.Count.EqualTo(1);
            var component = (HbmComponent)properties.First();

            component.Items.Should().Have.Count.EqualTo(2);
        }