public void GetAll_reeturns_doctor_list_and_check_list_count() { Mock <IUnitOfWork> unitOfWork = new Mock <IUnitOfWork>(); Mock <IMongoUnitOfWork> monguofw = new Mock <IMongoUnitOfWork>(); Mock <IUsersService> users = new Mock <IUsersService>(); DoctorService doctorService = new DoctorService(unitOfWork.Object, monguofw.Object, users.Object); List <Doctor> doctors = new List <Doctor>() { new Doctor() { Id = Guid.NewGuid(), Name = "Kristijan" }, new Doctor() { Id = Guid.NewGuid(), Name = "Filip" } }; unitOfWork.Setup(_ => _.Doctors.GetAllWithAppointmentAsync()).Returns(Task.FromResult <IEnumerable <Doctor> >(doctors)); var a = doctorService.GetAllWithAppointment(); var res = Assert.IsType <List <Doctor> >(a.Result); Assert.Equal(2, res.Count); }