示例#1
0
        public void MapManyDataOnMultipleEntries()
        {
            var dataEntries = new List <List <string> >
            {
                new List <string>
                {
                    "zapshroom",
                    "2",
                    "electro",
                    "150+ ",
                    "hyrule ridge %%  gerudo highlands"
                },
                new List <string>
                {
                    "freezeshroom",
                    "6",
                    "freeze",
                    "50+ ",
                    "a %%  b       %% c"
                }
            };

            var model1 = new Item
            {
                Name      = "zapshroom",
                Hp        = 2,
                Type      = "electro",
                Time      = 150,
                Locations = new[] { "hyrule ridge", "gerudo highlands" },
                Recipes   = new Recipe[] {}
            };

            var model2 = new Item
            {
                Name      = "freezeshroom",
                Hp        = 6,
                Type      = "freeze",
                Time      = 50,
                Locations = new[] { "a", "b", "c" },
                Recipes   = new Recipe[] {}
            };

            Assert.Equal(new List <Model> {
                model1, model2
            }, _subject.MapMany(dataEntries, new List <Model>()));
        }