Exemplo n.º 1
0
        public void WhenRelationThenAddSetPropertyWithSpecificRelation()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <Animal>(properties);

            map.Set(animal => animal.Offspring, cm => { }, rel => rel.OneToMany());

            properties.Should().Have.Count.EqualTo(1);
            object first = properties.First();

            first.Should().Be.OfType <HbmSet>().And.ValueOf.ElementRelationship.Should().Be.OfType <HbmOneToMany>();
        }
Exemplo n.º 2
0
        public void CanAddSetProperty()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <Animal>(properties);

            map.Set(animal => animal.Offspring, cm => { });

            properties.Should().Have.Count.EqualTo(1);
            object first = properties.First();

            first.Should().Be.OfType <HbmSet>().And.ValueOf.Name.Should().Be.EqualTo("Offspring");
        }
Exemplo n.º 3
0
        public void WhenNoRelationThenAddSetPropertyWithElement()
        {
            var properties = new List <object>();
            var map        = new StubPropertyContainerMapper <Human>(properties);

            map.Set(human => human.NickNames, cm => { });

            properties.Should().Have.Count.EqualTo(1);
            object first = properties.First();

            first.Should().Be.OfType <HbmSet>().And.ValueOf.ElementRelationship.Should().Be.OfType <HbmElement>().And.ValueOf.Type.
            name.Should().Be.EqualTo("String");
        }