コード例 #1
0
        public void NotaFiscal_Aplicacao_Salvar_DeveInserirOk()
        {
            NotaFiscal nota = ObjectMother.ObterNotaValida();

            nota.Id = 1;
            mockRepositorio.Setup(x => x.Salvar(nota)).Returns(nota);
            mockRepositorio.Setup(x => x.PegarPorId(nota.Id)).Returns(nota);

            NotaFiscal novaNota = notaFiscalServico.Salvar(nota);

            novaNota.Id.Should().BeGreaterThan(0);
            mockRepositorio.Verify(x => x.Salvar(nota));
            mockRepositorio.VerifyNoOtherCalls();
        }
        public void NotaFiscal_IntegracaoSistema_Salvar_DeveInserirOk()
        {
            NotaFiscal nota = ObjectMother.ObterNotaValida();

            NotaFiscal novaNota = notaFiscalServico.Salvar(nota);

            novaNota.Id.Should().BeGreaterThan(0);
        }