Exemplo n.º 1
0
        public void GetAllItems_Test()
        {
            db.Setup(x => x.Items.GetAll()).Returns(GetAllItems());

            List <ItemDTO> act = mapper.Map <List <ItemDTO> >(service.GetAllItems());
            var            exp = GetAllItems();

            Assert.NotNull(act);
            Assert.AreEqual(exp[0].ItemId, act[0].ItemId);
            Assert.AreEqual(exp[0].ItemName, act[0].ItemName);
            Assert.AreEqual(exp[1].Price, act[1].Price);
            Assert.AreEqual(exp[1].CategoryId, act[1].CategoryId);
        }