Beispiel #1
0
        public void MapToArray_PolymorphicElementTypesInCollections_DestinationValuesShouldMatch()
        {
            // Arrange
            var autoMapArray = new AutoMapArray(includeChildMapping: true);
            var sources      = new[]
            {
                new AutoMapArray.Source {
                    Value = 3
                },
                new AutoMapArray.ChildSource {
                    ValueChild = 4
                },
                new AutoMapArray.Source {
                    Value = 5
                },
            };


            // Act
            var destinations = autoMapArray.MapToArray(sources);

            // Assert
            destinations[0].ShouldBeEquivalentTo(sources[0]);
            destinations[1].ShouldBeEquivalentTo(sources[1]);
            destinations[2].ShouldBeEquivalentTo(sources[2]);
        }
Beispiel #2
0
        public void MapToArray_MultipleSourceValues_DestinationValuesShouldMatch()
        {
            // Arrange
            var autoMapArray = new AutoMapArray();
            var sources      = ConstructSources();

            // Act
            var result = autoMapArray.MapToArray(sources);

            // Assert
            result.ShouldBeEquivalentTo(sources);
        }