public void Search_Test() { db.Setup(x => x.Items.GetAll()).Returns(GetAllItems()); List <ItemDTO> act = mapper.Map <List <ItemDTO> >(service.Search("IPhone".ToLower())); var exp = GetItemsForSearch(); Assert.NotNull(act); Assert.AreEqual(exp[0].ItemId, act[0].ItemId); Assert.AreEqual(exp[0].ItemName, act[0].ItemName); Assert.AreEqual(exp[0].Price, act[0].Price); Assert.AreEqual(exp[0].CategoryId, act[0].CategoryId); }