public async Task TestUpdateCustomer() { using var context = new CustomersDbContext(dbContextOptions); var customerDTO = new CustomerInput { Name = "Petya", Surname = "Ivanov", Email = "*****@*****.**" }; var customer = new Customer(customerDTO) { Id = 2 }; var result = await customersController.UpdateCustomerAsync(2, customerDTO); Assert.That(result, Is.InstanceOf <OkResult>()); Assert.That(context.Find <Customer>((long)2), Is.EqualTo(customer)); }