public async Task GetHallIdWithValidId() { ApplicationDbContext dbContext = new ApplicationDbContext(new DbContextOptionsBuilder <ApplicationDbContext>() .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString()).Options); var service = new EmployeesService(new EfDeletableEntityRepository <Employee>(dbContext)); var date = DateTime.UtcNow; await service.AddAsync( "Ivan Ivanov", "*****@*****.**", "08888888888", date, "1"); var employee = await dbContext.Employees.FirstOrDefaultAsync(); var result = service.GetHallId(employee.Id); Assert.Equal("1", result); dbContext.Database.EnsureDeleted(); dbContext.Dispose(); }