Example #1
0
 public void AoIniciarUmaTransacaoDuasVezesDeveGerarErroDeTransacaoJaIniciada()
 {
     using (var conexao = new ConexaoFake())
         using (var transacao = conexao.IniciarTransacao() as TransacaoFake)
         {
             Action act = () => conexao.IniciarTransacao();
             act.ShouldThrow <TransacaoJaIniciadaException>();
         }
 }
Example #2
0
 public void AoIniciarUmaTransacaoNaoDeveGerarErro()
 {
     using (var conexao = new ConexaoFake())
     {
         Action act = () => conexao.IniciarTransacao();
         act.ShouldNotThrow();
     }
 }
Example #3
0
 public void AoConfirmarUmaTransacaoNaoDeveGerarErro()
 {
     using (var conexao = new ConexaoFake())
         using (var transacao = conexao.IniciarTransacao() as TransacaoFake)
         {
             Action act = () => transacao.ConfirmarTransacao();
             act.ShouldNotThrow();
         }
 }
Example #4
0
 public void AoConfirmarUmaTransacaoSemTransacaoDeveGerarErroDeTransacaoNaoIniciada()
 {
     using (var conexao = new ConexaoFake())
         using (var transacao = conexao.IniciarTransacao() as TransacaoFake)
         {
             transacao.ConfirmarTransacao();
             Action act = () => transacao.ConfirmarTransacao();
             act.ShouldThrow <TransacaoNaoIniciadaException>();
         }
 }
Example #5
0
 public void AoIniciarUmaTransacaoAPropriedadeTransacaoAtualDeveEstarPreenchida()
 {
     using (var conexao = new ConexaoFake())
         using (var transacao = conexao.IniciarTransacao() as TransacaoFake)
         {
             transacao.TransacaoAtual
             .Should()
             .NotBeNull();
         }
 }