public void Integration_AdicionarFaturamentoLoterica_Corretamente() { FaturamentoLoterica faturamentoLoterica = Loterica.Common.Tests.Lotericas.ObjectMother.GetFaturamento(); faturamentoLoterica.CalcularFaturamentoELucro(10, 2); _service.Adicionar(faturamentoLoterica); FaturamentoLoterica f = _service.Get(2); f.lucro.Should().Be(faturamentoLoterica.lucro); }
public void Service_FaturamentoLoterica_Deveria_Chamar_GetById_do_Repository() { _faturamentoLoterica = Loterica.Common.Tests.Lotericas.ObjectMother.GetFaturamentoComId(); _faturamentoLoterica.CalcularFaturamentoELucro(1000, 10); _faturamentoLotericaRepository .Setup(x => x.GetById(It.IsAny <int>())) .Returns(_faturamentoLoterica); FaturamentoLoterica faturamentoRecebido = _service.Get(_faturamentoLoterica.Id); _faturamentoLotericaRepository .Verify(x => x.GetById(_faturamentoLoterica.Id)); faturamentoRecebido.Should().BeEquivalentTo(_faturamentoLoterica); }