public void Get_By_Status() { //Arrange string status = "Отметка"; unitWorkMoq.Setup(x => x.Checkpoint.Find(It.IsAny <Func <Checkpoint, bool> >())) .Returns(itemsSimple.Where(x => x.Status == status)); unitWorkMoq.Setup(x => x.Checkpoint.Get(1)).Returns(itemsSimple[0]); unitWorkMoq.Setup(x => x.Checkpoint.Get(2)).Returns(itemsSimple[1]); unitWorkMoq.Setup(x => x.Type.Get(1)).Returns(itemsType[0]); unitWorkMoq.Setup(x => x.Type.Get(2)).Returns(itemsType[1]); unitWorkMoq.Setup(x => x.Type.Get(3)).Returns(itemsType[2]); unitWorkMoq.Setup(x => x.CheckpointAdmission.GetAll()).Returns(itemsCheckpointAdmission); unitWorkMoq.Setup(x => x.Admission.GetAll()).Returns(itemsAdmission); //Act var result = serviceMock.GetByStatus(status); //Assert Assert.IsNotNull(result); Assert.IsInstanceOfType(result, typeof(List <CheckpointDTO>)); Assert.AreEqual(1, result.ToList().Count); }