Пример #1
0
        public void TestGenerateGameplay()
        {
            PrizeLevels prizeLevels = createPrizeLevels();
            List<DivisionModel> divisions = new List<DivisionModel>();
            MainWindowModel.Instance.DivisionsModel = new DivisionsModel();

            DivisionModel div1 = new DivisionModel();
            div1.DivisionNumber = 1;
            div1.addPrizeLevel(prizeLevels.getPrizeLevel(0));
            divisions.Add(div1);

            DivisionModel div2 = new DivisionModel();
            div2.DivisionNumber = 2;
            div2.addPrizeLevel(prizeLevels.getPrizeLevel(1));
            divisions.Add(div2);

            //DivisionModel div3 = new DivisionModel();
            //div3.DivisionNumber = 3;
            //div3.addPrizeLevel(prizeLevels.getPrizeLevel(3));
            //divisions.Add(div3);

            //DivisionModel div4 = new DivisionModel();
            //div4.DivisionNumber = 4;
            //div4.addPrizeLevel(prizeLevels.getPrizeLevel(4));
            //divisions.Add(div4);

            ITile board = createBoard(prizeLevels);
            List<ITile> boards = new List<ITile>();
            boards.Add(board);
            GamePlayGeneration gp = new GamePlayGeneration(boards);
            gp.Generate(3, divisions, prizeLevels.prizeLevels, 1);
            string output = gp.GetFormattedGameplay(boards);
        }
Пример #2
0
 public void testAddPirzeLevel()
 {
     DivisionModel dm = new DivisionModel();
     for (int i = 0; i < testAmount; i++)
     {
         PrizeLevel pl = new PrizeLevel();
         pl.prizeValue = 100 + i;
         dm.addPrizeLevel(pl);
         Assert.IsTrue(dm.getPrizeLevel(i) != null, "PrizeLevel not added to Division.");
         Assert.IsTrue(dm.getPrizeLevel(i).prizeValue == 100 + i, "PrizeLevel not correct value.");
     }
 }
Пример #3
0
 public void testGetDivisionValue()
 {
     DivisionModel dm = new DivisionModel();
     double prizeLevel = 0.0f;
     for (int i = 0; i < testAmount; i++)
     {
         PrizeLevel pl = new PrizeLevel();
         pl.prizeValue = 100 + i;
         prizeLevel += pl.prizeValue;
         dm.addPrizeLevel(pl);
         Assert.IsTrue(dm.getPrizeLevel(i) != null, "PrizeLevel not added to Division.");
         Assert.IsTrue(dm.calculateDivisionValue() == prizeLevel, "PrizeLevel not correct value.");
     }
 }
Пример #4
0
 public void testGetPrizeLevelsAtDivision()
 {
     DivisionModel dm = new DivisionModel();
     for (int i = 0; i < testAmount; i++)
     {
         PrizeLevel pl = new PrizeLevel();
         pl.prizeValue = 100.0f + i;
         dm.addPrizeLevel(pl);
         Assert.IsTrue(dm.getPrizeLevelsAtDivision().Count == i + 1, "incorrect amount of prizes");
     }
 }
        public void testBuildGameDataFiveDivisionsNinePicks()
        {
            GameSetupModel gs = new GameSetupModel();
            gs.totalPicks = 9;

            PrizeLevel pl1 = new PrizeLevel();
            pl1.isInstantWin = false;
            pl1.numCollections = 5;
            pl1.prizeValue = 100;

            PrizeLevel pl2 = new PrizeLevel();
            pl2.isInstantWin = false;
            pl2.numCollections = 4;
            pl2.prizeValue = 50;

            PrizeLevel pl3 = new PrizeLevel();
            pl3.isInstantWin = false;
            pl3.numCollections = 4;
            pl3.prizeValue = 25;

            PrizeLevel pl4 = new PrizeLevel();
            pl4.isInstantWin = false;
            pl4.numCollections = 3;
            pl4.prizeValue = 10;

            PrizeLevel pl5 = new PrizeLevel();
            pl5.isInstantWin = false;
            pl5.numCollections = 3;
            pl5.prizeValue = 5;

            PrizeLevels pls = new PrizeLevels();
            pls.addPrizeLevel(pl1);
            pls.addPrizeLevel(pl2);
            pls.addPrizeLevel(pl3);
            pls.addPrizeLevel(pl4);
            pls.addPrizeLevel(pl5);

            DivisionModel dm1 = new DivisionModel();
            dm1.addPrizeLevel(pl1);
            dm1.MaxPermutations = 1000;

            DivisionModel dm2 = new DivisionModel();
            dm2.addPrizeLevel(pl1);
            dm2.addPrizeLevel(pl2);
            dm2.MaxPermutations = 1000;

            DivisionModel dm3 = new DivisionModel();
            dm3.addPrizeLevel(pl1);
            dm3.addPrizeLevel(pl3);
            dm3.MaxPermutations = 1000;

            DivisionModel dm4 = new DivisionModel();
            dm4.addPrizeLevel(pl2);
            dm4.addPrizeLevel(pl3);
            dm4.MaxPermutations = 1000;

            DivisionModel dm5 = new DivisionModel();
            dm5.addPrizeLevel(pl4);
            dm5.addPrizeLevel(pl5);
            dm5.MaxPermutations = 1000;

            DivisionsModel dms = new DivisionsModel();
            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);
            dms.addDivision(dm5);
            dms.LossMaxPermutations = 1000;

            FileGenerationService fgs = new FileGenerationService();
            fgs.buildGameData(dms, pls, gs, "testBuildGameDataFiveDivisionsNinePicks");
        }
        public void testBuildGameDataThreeDivisonsFourPicksWithLoss()
        {
            //Custom input for a game
            GameSetupModel gs = new GameSetupModel();
            gs.totalPicks = 4;

            PrizeLevel pl1 = new PrizeLevel();
            pl1.isInstantWin = false;
            pl1.numCollections = 3;
            pl1.prizeValue = 100;

            PrizeLevel pl2 = new PrizeLevel();
            pl2.isInstantWin = false;
            pl2.numCollections = 2;
            pl2.prizeValue = 50;

            PrizeLevel pl3 = new PrizeLevel();
            pl3.isInstantWin = false;
            pl3.numCollections = 2;
            pl3.prizeValue = 25;

            PrizeLevels pls = new PrizeLevels();
            pls.addPrizeLevel(pl1);
            pls.addPrizeLevel(pl2);
            pls.addPrizeLevel(pl3);

            DivisionModel dm1 = new DivisionModel();
            dm1.addPrizeLevel(pl1);
            dm1.MaxPermutations = 1000;

            DivisionModel dm2 = new DivisionModel();
            dm2.addPrizeLevel(pl2);
            dm2.MaxPermutations = 1000;

            DivisionModel dm3 = new DivisionModel();
            dm3.addPrizeLevel(pl2);
            dm3.addPrizeLevel(pl3);
            dm3.MaxPermutations = 1000;

            DivisionModel dm4 = new DivisionModel();
            dm4.MaxPermutations = 1000;

            DivisionsModel dms = new DivisionsModel();
            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);
            dms.LossMaxPermutations = 1000;

            //File Generator
            FileGenerationService fgs = new FileGenerationService();
            fgs.buildGameData(dms, pls, gs, "testBuildGameDataThreeDivisonsFourPicksWithLoss");
        }