Esempio n. 1
0
        public async Task NullCigarShouldThrowException()
        {
            SqlCigarRepository repository = CreateRepository();

            ArgumentNullException exception = await Assert.ThrowsAsync <ArgumentNullException>(
                () => repository.Save(null));

            Assert.Equal("cigar", exception.ParamName);
        }
Esempio n. 2
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);
        }