public void FakeCustomersRepoShouldReturnThreeCustomers() { // Act var customers = customersRepo.GetCustomers(); // Assert var customersListHasThreeCustomers = customers.Count == 3; Assert.IsTrue(customersListHasThreeCustomers); }
public void FakeConnectionCheckerChangesVehicleStatus() { // Arrange var customers = customersRepo.GetCustomers(); var connectionChecker = new FakeConnectionChecker(); // Act connectionChecker.CheckVehiclesConnection(customers); // Assert // Check if any connection status is changed var statusChanged = customers.SelectMany(customer => customer.OwnedVehicles).Any(vehicle => vehicle.Status); Assert.IsNotNull(statusChanged); }
// GET: Customers public async Task <IActionResult> Index() { return(View(await Task.Run(() => _customersRepo.GetCustomers()))); }