Beispiel #1
0
 public void CalcTheFiveMostCommonNumbersTest()
 {
     foreach (Enums.LotteryType lt in (Enums.LotteryType[])Enum.GetValues(typeof(Enums.LotteryType)))
     {
         var lh = new LotteryHandler(lt, "Whem", false, false);
         lh.CalculateNumbers(Enums.TypesOfDrawn.ByAverageRandoms, Enums.GenerateType.EachByEach, 20);
         lh.CalculateNumbers(Enums.TypesOfDrawn.ByDistributionBasedCurrentDraw, Enums.GenerateType.Unique, 1);
         Assert.True(
             lh.LotteryModels.Count(x => x.Message == Enums.TypesOfDrawn.ByDistributionBasedCurrentDraw) > 0);
     }
 }
Beispiel #2
0
 public void SaveDataToGoogleSheetTest()
 {
     foreach (Enums.LotteryType lt in (Enums.LotteryType[])Enum.GetValues(typeof(Enums.LotteryType)))
     {
         var lh = new LotteryHandler(lt, "Whem", true, false);
         lh.CalculateNumbers(Enums.TypesOfDrawn.ByInterval, Enums.GenerateType.EachByEach, 1);
         Assert.True(lh.SaveDataToGoogleSheet() != null);
     }
 }
Beispiel #3
0
        public MainWindowViewModel()
        {
            // GoNext = ReactiveCommand.CreateFromObservable(() => Router.Navigate.Execute(new LoginViewModel(this)));

            Lottery = new LotteryHandler(Enums.LotteryType.TheSixNumberDraw, "Whem", true, true);
            LotteryHandler.LotteryModelEvent += LotteryHandlerOnLotteryModelEvent;



            Lottery.CalculateNumbers(Enums.TypesOfDrawn.All, Enums.GenerateType.EachByEach, 2);
            Lottery.CalculateNumbers(Enums.TypesOfDrawn.All, Enums.GenerateType.GetTheBest, 1000);
            Lottery.CalculateNumbers(Enums.TypesOfDrawn.All, Enums.GenerateType.MostCommonSeries, 1000);


            Lottery.UseEarlierWeekPercentageForNumbersDraw(Enums.TypesOfDrawn.Calculated);
            Lottery.CalculateNumbers(Enums.TypesOfDrawn.ByDistributionBasedCurrentDraw, Enums.GenerateType.Unique, 1);

            Lottery.SaveDataToGoogleSheet();
        }
Beispiel #4
0
        public void RunMethodWithEachTimeAndGetTheBestNumbersTest()
        {
            foreach (Enums.LotteryType lt in (Enums.LotteryType[])Enum.GetValues(typeof(Enums.LotteryType)))
            {
                var lh = new LotteryHandler(lt, "Whem", false, false);
                lh.CalculateNumbers(Enums.TypesOfDrawn.All, Enums.GenerateType.GetTheBest, 1000);

                Assert.True(lh.LotteryModels != null);
            }
        }
Beispiel #5
0
        public void ByOccurrenceExecuteTest()
        {
            foreach (Enums.LotteryType lt in (Enums.LotteryType[])Enum.GetValues(typeof(Enums.LotteryType)))
            {
                var testEnum = Enums.TypesOfDrawn.ByOccurrence;
                var lh       = new LotteryHandler(lt, "Whem", false, false);
                lh.CalculateNumbers(testEnum, Enums.GenerateType.EachByEach, 20);

                Assert.True(
                    lh.LotteryModels.Count(x => x.Message == testEnum) > 0);
            }
        }
Beispiel #6
0
        public void UseEarlierWeekPercentageForNumbersDrawTest()
        {
            foreach (Enums.LotteryType lt in (Enums.LotteryType[])Enum.GetValues(typeof(Enums.LotteryType)))
            {
                var lh = new LotteryHandler(lt, "Whem", true, true);
                lh.CalculateNumbers(Enums.TypesOfDrawn.ByAverageRandoms, Enums.GenerateType.EachByEach, 20);

                try
                {
                    lh.UseEarlierWeekPercentageForNumbersDraw(Enums.TypesOfDrawn.Calculated);
                    var test = lh.LotteryModels.Count(x => x.Message == Enums.TypesOfDrawn.Calculated);
                    Assert.True(test > 0);
                }
                catch (Exception e)
                {
                    Assert.True(e.Message != null);
                }
            }
        }