Created
July 11, 2012 21:59
-
-
Save waldyrfelix/3093920 to your computer and use it in GitHub Desktop.
Mock para verificar sequencia de chamadas (iniciar transação, inserir um pacote de desconto, finalizar transação)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[TestMethod] | |
public void CadastrarPacoteDeDesconto_deve_chamar_o_repositorio_inserindo_o_pacotes_de_descontos_numa_transação() | |
{ | |
// arrange | |
var pacote = new PacoteDesconto(); | |
var mockUnitOfWork = TestHelper.MockUnitOfWork(); | |
using (Sequence.Create()) | |
{ | |
mockUnitOfWork.Setup(_ => _.Iniciar()).InSequence(); | |
_mockDoRepositorioDePacotesDeDesconto.Setup(_ => _.Inserir(pacote)).InSequence(); | |
mockUnitOfWork.Setup(_ => _.Finalizar()).InSequence(); | |
// act | |
_serviço.CadastrarPacoteDeDesconto(pacote); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment