Example #1
0
        public void Integration_AdicionarAposta_Corretamente()
        {
            _aposta = ObjectMother.GetAposta();
            _service.Adicionar(_aposta);
            var recebeAposta = _service.Get(2);

            recebeAposta.Should().NotBeNull();
            recebeAposta.numerosApostados.Should().BeEquivalentTo(_aposta.numerosApostados);
        }
Example #2
0
        public void Service_Aposta_Deveria_Adicionar_Aposta()
        {
            _aposta = ObjectMother.GetAposta();
            _apostaRepository

            .Setup(x => x.Adicionar(It.IsAny <Aposta>()))
            .Returns(new Aposta(new Concurso
            {
                Id                = 1,
                dataFechamento    = DateTime.Now.AddHours(2),
                valorTotalApostas = 8001,
            })
            {
                Id = 1,
                numerosApostados = new List <int> {
                    1, 2, 3, 4, 5, 6
                },
            });

            _service.Adicionar(_aposta);
            _apostaRepository.Verify(x => x.Adicionar(_aposta));
        }