public void EditAsync_ReturnsCorrectNumberOfModifiedEntries() { var options = new DbContextOptionsBuilder <ApplicationDbContext>().UseInMemoryDatabase(Guid.NewGuid().ToString()).Options; using (var dbContext = new ApplicationDbContext(options)) { Reservation reservation = new Reservation() { VehicleMake = "BMW", VehicleModel = "M5", LicenseNumber = "СА 1234 КР", PhoneNumber = "0897482124", ReservationDateTime = new DateTime(2020, 3, 21, 10, 30, 10), }; var reservationsService = new ReservationsService(dbContext); dbContext.Reservations.Add(reservation); dbContext.SaveChanges(); var result = reservationsService.EditAsync(reservation.Id); Assert.Equal(1, result.Result); } }