public async Task ShouldSaveProvidedCigar() { SqlCigarRepository repository = CreateRepository(); Cigar newCigar = Cigar.New(); await repository.Save(newCigar); Cigar savedCigar = await repository.Load(newCigar.Id); Assert.Equal(newCigar.Id, savedCigar.Id); }
/// <inheritdoc /> public async Task <Guid> Handle(AddCigarCommand request, CancellationToken cancellationToken) { if (request == null) { throw new ArgumentNullException(nameof(request)); } Cigar cigar = Cigar.New(); await _cigarRepository.Save(cigar); return(cigar.Id); }
public void ShouldHaveExpectedState() { Cigar cigar = Cigar.New(); Assert.NotEqual(Guid.Empty, cigar.Id); }