Exemple #1
0
        public void CollectionsOfSimpleValuesShouldBeMapped_EvenWhenThePropertyOnlyHasASetter()
        {
            var doc = new XmlDocument();
            doc.LoadXml(XML);

            var person = new ConfigMapper(doc.DocumentElement).GetObjectFromXml<PersonWO>();
            var car = person.GetCar();
            car.Make.Should().Be("Ford");
            car.Year.Should().Be(2010);

            var stereo = car.GetStereo();
            stereo.Model.Should().Be("Alpine");
            stereo.MP3.Should().BeTrue();
        }
Exemple #2
0
        public void CollectionsOfSimpleValuesShouldBeMapped_EvenWhenThePropertyOnlyHasASetter()
        {
            var doc = new XmlDocument();

            doc.LoadXml(XML);

            var person = new ConfigMapper(doc.DocumentElement).GetObjectFromXml <PersonWO>();
            var car    = person.GetCar();

            car.Make.Should().Be("Ford");
            car.Year.Should().Be(2010);

            var stereo = car.GetStereo();

            stereo.Model.Should().Be("Alpine");
            stereo.MP3.Should().BeTrue();
        }