public async Task CheckGettingAppointmentsHistoryUserAsync() { ApplicationDbContext db = GetDb(); var repository = new EfDeletableEntityRepository <Appointment>(db); var usersService = new Mock <IUsersService>(); var cardsService = new Mock <ICardsService>(); var categoriesRepository = new EfDeletableEntityRepository <Category>(db); var categoryService = new CategoriesService(categoriesRepository); var proceduresRepository = new EfDeletableEntityRepository <Procedure>(db); var procedureReviewsRepository = new EfDeletableEntityRepository <Review>(db); var procedureProductsRepository = new EfRepository <ProcedureProduct>(db); var procedureStylistsRepository = new EfRepository <ProcedureStylist>(db); var skinProblemProcedureRepository = new EfRepository <SkinProblemProcedure>(db); var proceduresService = new ProceduresService( proceduresRepository, procedureReviewsRepository, procedureProductsRepository, procedureStylistsRepository, skinProblemProcedureRepository, repository, categoryService); var service = new AppointmentsService( repository, usersService.Object, cardsService.Object, proceduresService, categoryService); await db.Procedures.AddAsync(this.procedure); await db.Categories.AddAsync(this.category); await db.SaveChangesAsync(); string appId = await this.GetAppointmentIdAsync(service); await service.DoneAsync(appId); var firstApp = await GetAppointmentAsync(repository, appId); firstApp.IsReview = true; repository.Update(firstApp); await repository.SaveChangesAsync(); var resultAppointments = await service.GetHistoryUserAsync <TestAppointmentModel>(this.client.Id); Assert.Single(resultAppointments); }