Ejemplo n.º 1
0
        public void should_map_correctly()
        {
            var wowheadItem = new WowheadItem
            {
                Id      = 1,
                Name    = "Name",
                Slot    = 1,
                Quality = 2,
                Sources = new List <IWowheadItemSource>
                {
                    new WowheadItemSource
                    {
                        Name = "wowheaditem one",
                        Zone = 2
                    },
                    new WowheadItemSource
                    {
                        Name = "wowheaditem two",
                        Zone = 1
                    }
                }
            };

            var result = Mapper.Map <IWowheadItem, Item>(wowheadItem);

            Assert.AreEqual(wowheadItem.Id, result.ItemId);
            Assert.AreEqual(wowheadItem.Name, result.Name);
            Assert.AreEqual("Head", result.Slot.ToString());
            Assert.AreEqual("Uncommon", result.Quality.ToString());
        }
Ejemplo n.º 2
0
        public void should_map_even_when_quality_is_null()
        {
            var wowheadItem = new WowheadItem
            {
                Id      = 1,
                Name    = "Name",
                Slot    = 1,
                Quality = null
            };

            var result = Mapper.Map <IWowheadItem, Entities.Item>(wowheadItem);

            Assert.AreEqual(wowheadItem.Id, result.ItemId);
            Assert.AreEqual(wowheadItem.Name, result.Name);
            Assert.AreEqual("Head", result.Slot.ToString());
            Assert.AreEqual("Unknown", result.Quality.ToString());
        }