コード例 #1
0
        public void MapInto_List_dynamic()
        {
            var source = new []
            {
                new { Id = 11, Name = "Property31" },
                new { Id = 12, Name = "Property32" }
            };

            var result = ObjectsMapper.MapIntoListOf <OtherInner>(source);

            Assert.True(result.Count() == 2);
            Assert.True(result.First().Id == 11);
            Assert.True(result.Last().Id == 12);
        }
コード例 #2
0
        public void MapInto_List_Dictionary_Anonymous()
        {
            var source = new Dictionary <string, object>
            {
                { "First", new { Id = 11, Name = "Property31" } },
                { "Second", new { Id = 12, Name = "Property32" } }
            };

            var result = ObjectsMapper.MapIntoListOf <OtherInner>(source);

            Assert.True(result.Count() == 2);
            Assert.True(result.First().Id == 11);
            Assert.Equal("Property31", result.First().Name);
            Assert.True(result.Last().Id == 12);
            Assert.Equal("Property32", result.Last().Name);
        }