public async Task CompleteRentalFromGuidAsync() { var rentalId = await rentalRepository.AddAsync(rental); await rentalRepository.CompleteRentalAsync(rentalId); var dtoRental = await rentalRepository.GetAsync(rentalId); Assert.True(dtoRental.HasBeenReturned); }
public async Task CompleteRentalAsync(Guid rentalId, CancellationToken cancellationToken = default) { if (rentalId == Guid.Empty) { throw new ArgumentNullException(nameof(rentalId)); } await rentalRepository.CompleteRentalAsync(rentalId); var dtoRental = await rentalRepository.GetAsync(rentalId); await rentalRecordsRepository.AddAsync(dtoRental.CreateCompleteDtoRentalRecord(), cancellationToken); }