Esempio n. 1
0
        public void RetornaGanhadoresQuina()
        {
            ApostaNeg.NumerosSorteados = new List <int>();
            ApostaNeg.NumerosSorteados.Add(1);
            ApostaNeg.NumerosSorteados.Add(2);
            ApostaNeg.NumerosSorteados.Add(3);
            ApostaNeg.NumerosSorteados.Add(4);
            ApostaNeg.NumerosSorteados.Add(5);
            ApostaNeg.NumerosSorteados.Add(6);

            RegistrarApostaClass apost = new RegistrarApostaClass()
            {
                CodigoTipoAposta = (char)ETipoAposta.MegaSena,
                Numeros          = new int[] { 1, 2, 3, 4, 5, 60 }
            };

            ApostaNeg.RegistrarNovaAposta(apost);

            IList <RegistrarApostaClass> resultado = ApostaNeg.RetornaGanhadoresQuina((char)ETipoAposta.MegaSena);

            if (resultado != null && resultado.Count > 0)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
Esempio n. 2
0
        public void RetornaApostas()
        {
            IList <RegistrarApostaClass> resultado = ApostaNeg.RetornaApostas((char)ETipoAposta.MegaSena);

            if (resultado != null)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
Esempio n. 3
0
        public void ObterNumerosSorteados()
        {
            IList <int> resultado = ApostaNeg.ObterNumerosSorteados((char)ETipoAposta.MegaSena);

            if (resultado != null && resultado.Count > 0)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
Esempio n. 4
0
        public void SortearResultadoAposta()
        {
            IList <int> resultado = ApostaNeg.SortearResultado((char)ETipoAposta.MegaSena);

            if (resultado != null)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
Esempio n. 5
0
 public IEnumerable <RegistrarApostaClass> RetornaApostas([FromBody] RegistrarApostaClass aposta)
 {
     try
     {
         return(ApostaNeg.RetornaApostas(aposta.CodigoTipoAposta));
     }
     catch
     {
         return(new List <RegistrarApostaClass>());
     }
 }
Esempio n. 6
0
 public IEnumerable <RegistrarApostaClass> CarregarGanhadoresQuadra([FromBody] RegistrarApostaClass aposta)
 {
     try
     {
         return(ApostaNeg.RetornaGanhadoresQuadra(aposta.CodigoTipoAposta));
     }
     catch
     {
         return(new List <RegistrarApostaClass>());
     }
 }
Esempio n. 7
0
        public void RegistrarNovaApostaTest()
        {
            RegistrarApostaClass apost = new RegistrarApostaClass()
            {
                CodigoTipoAposta = (char)ETipoAposta.MegaSena,
                Numeros          = new int[] { 1, 2, 3, 4, 5, 6 }
            };

            ApostaNeg.RegistrarNovaAposta(apost);

            Assert.Pass();
        }
Esempio n. 8
0
 public NumResultadoClass ObterNumerosSorteados(char tipoAposta)
 {
     try
     {
         return(new NumResultadoClass()
         {
             Numeros = string.Join(" - ", ApostaNeg.ObterNumerosSorteados(tipoAposta))
         });
     }
     catch
     {
         return(new NumResultadoClass());
     }
 }
 public RegistrarApostaClass Surpresinha([FromBody] RegistrarApostaClass aposta)
 {
     try
     {
         return(ApostaNeg.Surpresinha(aposta.CodigoTipoAposta));
     }
     catch (ApostaException ex)
     {
         return(new RegistrarApostaClass()
         {
             MensagemErro = ex.Mensagem
         });
     }
 }
 public RegistrarApostaClass RegistarAposta([FromBody] RegistrarApostaClass aposta)
 {
     try
     {
         return(ApostaNeg.RegistrarNovaAposta(aposta));
     }
     catch (ApostaException ex)
     {
         return(new RegistrarApostaClass()
         {
             MensagemErro = ex.Mensagem
         });
     }
 }
Esempio n. 11
0
        public void RegistrarNovaApostaErroNumero4()
        {
            RegistrarApostaClass apost = new RegistrarApostaClass()
            {
                CodigoTipoAposta = (char)ETipoAposta.MegaSena,
                Numeros          = new int[] { 1, 2, 3, 4, 5, 90 }
            };

            try
            {
                ApostaNeg.RegistrarNovaAposta(apost);
            }
            catch (ApostaException)
            {
                Assert.Pass();
            }

            Assert.Fail();
        }
Esempio n. 12
0
        public void RegistrarNovaApostaErroTipo()
        {
            RegistrarApostaClass apost = new RegistrarApostaClass()
            {
                CodigoTipoAposta = 'R',
                Numeros          = new int[] { 1, 2, 3, 4, 5, 6 }
            };

            try
            {
                ApostaNeg.RegistrarNovaAposta(apost);
            }
            catch (ApostaException)
            {
                Assert.Pass();
            }

            Assert.Fail();
        }
Esempio n. 13
0
        public void RegistrarNovaApostaSurpresinha()
        {
            ApostaNeg.Surpresinha((char)ETipoAposta.MegaSena);

            Assert.Pass();
        }