public async Task GetOpenDrawsInformationMethodShouldReturnDeserializeObjectForValidRequest()
        {
            ApiHelper.InitializeClient();

            DrawsRequestItem requestContent = new DrawsRequestItem();

            requestContent.CompanyId             = Common.LotteriesCompany.Tattersalls;
            requestContent.MaxDrawCount          = 5;
            requestContent.OptionalProductFilter = new string[] { Common.LotteriesProduct.TattsLotto.ToString() };

            var drawResults = await OpenDrawsProcessor.GetOpenDrawsInformation(requestContent);

            Assert.IsNotNull(drawResults);
            Assert.IsNull(drawResults.ErrorInfo);
            Assert.IsTrue(drawResults.Success);
            Assert.AreEqual(drawResults.Draws.Count, 5);
            Assert.AreEqual(drawResults.Draws[0].ProductId, Common.LotteriesProduct.TattsLotto);
        }
コード例 #2
0
        public async Task <ActionResult> NTLotteriesGetInformation()
        {
            DrawsRequestItem requestContent = new DrawsRequestItem();

            requestContent.CompanyId             = Common.LotteriesCompany.NTLotteries;
            requestContent.MaxDrawCount          = 30;
            requestContent.OptionalProductFilter = new string[] { Common.LotteriesProduct.TattsLotto.ToString(), Common.LotteriesProduct.OzLotto.ToString(),
                                                                                                                 Common.LotteriesProduct.Powerball.ToString(), Common.LotteriesProduct.Super66.ToString(), Common.LotteriesProduct.Pools.ToString(),
                                                                                                                 Common.LotteriesProduct.MonWedLotto.ToString(), Common.LotteriesProduct.LuckyLotteries2.ToString(), Common.LotteriesProduct.LuckyLotteries5.ToString(),
                                                                                                                 Common.LotteriesProduct.LottoStrike.ToString(), Common.LotteriesProduct.WedLotto.ToString(), Common.LotteriesProduct.Keno.ToString(),
                                                                                                                 Common.LotteriesProduct.CoinToss.ToString(), Common.LotteriesProduct.SetForLife.ToString(), Common.LotteriesProduct.MultiProduct.ToString(),
                                                                                                                 Common.LotteriesProduct.InstantScratchIts.ToString(), Common.LotteriesProduct.TwoDollarCasket.ToString(), Common.LotteriesProduct.BonusDraws.ToString() };

            var drawResults = await OpenDrawsProcessor.GetOpenDrawsInformation(requestContent);

            ViewBag.Message = "NT Lotteries open draws information";

            return(View(drawResults.Draws));
        }