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