Exemplo n.º 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);
        }
Exemplo n.º 2
0
        public void Aposta_ServiceTest_GetBet_ShouldBeOk()
        {
            Aposta apostaToFind = ObjectMother.GetAposta(_bolao, _concurso);

            apostaToFind._Dezenas = ObjectMother.GetListDezenas(apostaToFind);
            apostaToFind.id       = 1;
            _mockRepository.Setup(ar => ar.Get(apostaToFind.id)).Returns(apostaToFind);

            Action comparation = () => _service.Get(apostaToFind.id);

            comparation.Should().NotThrow();
            _mockRepository.Verify(ar => ar.Get(apostaToFind.id));
        }
Exemplo n.º 3
0
        public void Service_Aposta_Deveria_BuascarPorId_Aposta_Corretamente()
        {
            _aposta = ObjectMother.GetApostaComId();

            _apostaRepository
            .Setup(x => x.GetById(It.IsAny <int>()))
            .Returns(_aposta);

            Aposta a = _service.Get(_aposta.Id);

            _apostaRepository.Verify(x => x.GetById(_aposta.Id));
            a.numerosApostados.Should().BeEquivalentTo(_aposta.numerosApostados);
        }