Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        /// <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);
        }
Esempio n. 3
0
        public void ShouldHaveExpectedState()
        {
            Cigar cigar = Cigar.New();

            Assert.NotEqual(Guid.Empty, cigar.Id);
        }