예제 #1
0
        public void RetornaGanhadores()
        {
            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, 6 }
            };

            ApostaNeg.RegistrarNovaAposta(apost);

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

            if (resultado != null && resultado.Count > 0)
            {
                Assert.Pass();
            }
            Assert.Fail();
        }
예제 #2
0
 public IEnumerable <RegistrarApostaClass> CarregarGanhadores([FromBody] RegistrarApostaClass aposta)
 {
     try
     {
         return(ApostaNeg.RetornaGanhadores(aposta.CodigoTipoAposta));
     }
     catch
     {
         return(new List <RegistrarApostaClass>());
     }
 }