public async Task DriversService_Test_Call_All_CRUD_Methods_ShouldWork() { // Arrange // Act var actualDriversCount = await _myShuttleClient.DriversService.GetCountAsync(string.Empty); var newDriver = new Driver() { CarrierId = 1, Name = "Name", Phone = "Phone", Picture = null }; var driverId = await _myShuttleClient.DriversService.PostAsync(newDriver); //Assert driverId.Should().BeGreaterThan(0); var newDriversCount = await _myShuttleClient.DriversService.GetCountAsync(string.Empty); newDriversCount.Should().Be(actualDriversCount + 1); var currentDriver = await _myShuttleClient.DriversService.GetAsync(driverId); //assert currentDriver.Should().NotBeNull(); currentDriver.Name = Guid.NewGuid().ToString(); await _myShuttleClient.DriversService.PutAsync(currentDriver); var updateDriver = await _myShuttleClient.DriversService.GetAsync(driverId); updateDriver.Should().NotBeNull(); updateDriver.Name.Should().Be(currentDriver.Name); await _myShuttleClient.DriversService.DeleteAsync(driverId); newDriversCount = await _myShuttleClient.DriversService.GetCountAsync(string.Empty); newDriversCount.Should().Be(actualDriversCount); }
private bool IsDriverCompleteLoaded(Driver driver) { return driver != null && driver.Picture != null; }