public void FilterByCriteria_Test() { db.Setup(x => x.Items.GetAll()).Returns(GetAllItems()); db.Setup(x => x.ItemCharacteristics.GetById(1)).Returns(GetAllItemCharacteristic()[0]); db.Setup(x => x.ItemCharacteristics.GetById(2)).Returns(GetAllItemCharacteristic()[1]); db.Setup(x => x.ItemCharacteristics.GetById(3)).Returns(GetAllItemCharacteristic()[2]); db.Setup(x => x.ItemCharacteristics.GetById(4)).Returns(GetAllItemCharacteristic()[3]); List <ItemDTO> act = mapper.Map <List <ItemDTO> >(service.FilterByCriteria(GetFilterCriteries())); var exp = GetItemCharacteristicWithCriteria(); Assert.NotNull(act); Assert.AreEqual(2, act.Count); Assert.AreEqual(exp[0].Camera, act[0].ItemCharacteristic.Camera); Assert.AreEqual(exp[0].RAM, act[0].ItemCharacteristic.RAM); Assert.AreEqual(exp[1].Memory, act[1].ItemCharacteristic.Memory); Assert.AreEqual(exp[1].DisplayDiagonal, act[1].ItemCharacteristic.DisplayDiagonal); }