示例#1
0
        public bool OpenProject()
        {
            bool loadSuccessful = true;

            Microsoft.Win32.OpenFileDialog openDialog = new Microsoft.Win32.OpenFileDialog();
            openDialog.DefaultExt = DEFAULT_EXT;
            openDialog.Filter     = FILTER;
            bool?result            = openDialog.ShowDialog();
            bool isCorrectFileType = System.Text.RegularExpressions.Regex.IsMatch(openDialog.FileName, DEFAULT_EXT);

            if (result == true && isCorrectFileType) //User pressed OK and the extension is correct
            {
                loadSuccessful  = true;
                projectFileName = openDialog.FileName;

                IFormatter  format        = new BinaryFormatter();
                Stream      stream        = new FileStream(projectFileName, FileMode.Open, FileAccess.Read, FileShare.Read);
                ProjectData loadedProject = (ProjectData)format.Deserialize(stream);
                savedPrizeLevels = loadedProject.savedPrizeLevels;
                savedGameSetup   = loadedProject.savedGameSetup;
                savedDivisions   = loadedProject.savedDivisions;
            }
            else if (result == true && !isCorrectFileType) //User pressed OK, but the extension is incorrect
            {
                System.Windows.MessageBox.Show("The file must be of type " + DEFAULT_EXT);
                loadSuccessful = this.OpenProject();
            }
            else if (result == false) //User pressed Cancel or closed the dialog box
            {
                loadSuccessful = false;
            }

            return(loadSuccessful);
        }
        public void testBuildGameDataThreeDivisonsFourPicksWithLoss()
        {
            //Custom input for a game
            GameSetupModel gs = new GameSetupModel();

            gs.maxPermutations = 1000;
            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);

            DivisionModel dm2 = new DivisionModel();

            dm2.addPrizeLevel(pl2);

            DivisionModel dm3 = new DivisionModel();

            dm3.addPrizeLevel(pl2);
            dm3.addPrizeLevel(pl3);

            DivisionModel dm4 = new DivisionModel();

            DivisionsModel dms = new DivisionsModel();

            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);

            //File Generator
            FileGenerationService fgs = new FileGenerationService();

            fgs.buildGameData(dms, pls, gs, "testBuildGameDataThreeDivisonsFourPicksWithLoss");
        }
示例#3
0
        public void TestNearWinsGetSet()
        {
            GameSetupModel gsm = new GameSetupModel();

            Assert.IsTrue(gsm.nearWins == 0, "nearWins should still be 0.");
            gsm.nearWins = 5;
            Assert.IsTrue(gsm.nearWins == 5, "nearWins should have been set to 5.");
        }
示例#4
0
        public void TestTotalPicksGetSet()
        {
            GameSetupModel gsm = new GameSetupModel();

            Assert.IsTrue(gsm.totalPicks == 0, "totalPicks should still be 0.");
            gsm.totalPicks = 5;
            Assert.IsTrue(gsm.totalPicks == 5, "totalPicks should have been set to 5.");
        }
示例#5
0
        public void TestIsNearWinGetSet()
        {
            GameSetupModel gsm = new GameSetupModel();

            Assert.IsTrue(!gsm.isNearWin, "isNearWin should still be false.");
            gsm.isNearWin = true;
            Assert.IsTrue(gsm.isNearWin, "isNearWin should have been set to true.");
        }
示例#6
0
        public void TestMaxPermutationsGetSet()
        {
            GameSetupModel gsm = new GameSetupModel();

            Assert.IsTrue(gsm.maxPermutations == 0, "maxPermutations should still be 0.");
            gsm.maxPermutations = 5;
            Assert.IsTrue(gsm.maxPermutations == 5, "maxPermutations should have been set to 5.");
        }
示例#7
0
        public void TestToggleIsNearWin()
        {
            GameSetupModel gsm = new GameSetupModel();

            Assert.IsTrue(!gsm.isNearWin, "isNearWin should still be false.");
            gsm.toggleNearWin();
            Assert.IsTrue(gsm.isNearWin, "isNearWin should have been set to true.");
            gsm.toggleNearWin();
            Assert.IsTrue(!gsm.isNearWin, "isNearWin should be false again.");
        }
示例#8
0
        public void SaveProject(GameSetupModel gsObject, PrizeLevels.PrizeLevels plsObject, DivisionsModel divisionsList)
        {
            if (isProjectSaved)
            {
                savedGameSetup   = gsObject;
                savedPrizeLevels = plsObject;
                savedDivisions   = divisionsList;

                IFormatter formatter = new BinaryFormatter();
                Stream     stream    = new FileStream(projectFileName, FileMode.OpenOrCreate, FileAccess.Write, FileShare.None);
                formatter.Serialize(stream, this);
                stream.Close();
            }
            else
            {
                SaveProjectAs(gsObject, plsObject, divisionsList);
            }
        }
示例#9
0
        public void SaveProjectAs(GameSetupModel gsObject, PrizeLevels.PrizeLevels plsObject, DivisionsModel divisionsList)
        {
            Microsoft.Win32.SaveFileDialog dialog = new Microsoft.Win32.SaveFileDialog();
            if (String.IsNullOrEmpty(projectFileName))
            {
                dialog.FileName = "CollectionGameGeneratorProject" + DEFAULT_EXT;
            }
            else
            {
                dialog.FileName = projectFileName;
            }
            dialog.DefaultExt = DEFAULT_EXT;
            dialog.Filter     = FILTER;
            bool?result = dialog.ShowDialog();

            if (result == true)
            {
                projectFileName = dialog.FileName;
                isProjectSaved  = true;
                SaveProject(gsObject, plsObject, divisionsList);
            }
        }
        public void testBuildGameDataMaxDivison()
        {
            GameSetupModel gs = new GameSetupModel();

            gs.maxPermutations = 300000;
            gs.totalPicks      = 20;

            int numPrizeLevels = 12;

            PrizeLevel[] prizes = new PrizeLevel[numPrizeLevels];
            PrizeLevels  pls    = new PrizeLevels();

            for (int i = 0; i < numPrizeLevels; i++)
            {
                prizes[i] = new PrizeLevel();
                prizes[i].isInstantWin   = false;
                prizes[i].numCollections = i + 1;
                prizes[i].prizeValue     = 100 * i;
                pls.addPrizeLevel(prizes[i]);
            }

            int numberOfDivions = 30;

            DivisionModel[] divisions = new DivisionModel[numberOfDivions];
            DivisionsModel  dms       = new DivisionsModel();
            Random          rand      = new Random();

            for (int i = 0; i < numberOfDivions; i++)
            {
                divisions[i] = new DivisionModel();
                divisions[i].addPrizeLevel(prizes[rand.Next(0, 12)]);
                dms.addDivision(divisions[i]);
            }

            FileGenerationService fgs = new FileGenerationService();

            fgs.buildGameData(dms, pls, gs, "T:\\Work\\JunkOut\\MaxTest.txt");
        }
        public void testBuildGameDataFourDivisionsSixPicks()
        {
            GameSetupModel gs = new GameSetupModel();

            gs.maxPermutations = 1000;
            gs.totalPicks      = 6;

            PrizeLevel pl1 = new PrizeLevel();

            pl1.isInstantWin   = false;
            pl1.numCollections = 3;
            pl1.prizeValue     = 100;

            PrizeLevel pl2 = new PrizeLevel();

            pl2.isInstantWin   = false;
            pl2.numCollections = 3;
            pl2.prizeValue     = 50;

            PrizeLevel pl3 = new PrizeLevel();

            pl3.isInstantWin   = false;
            pl3.numCollections = 3;
            pl3.prizeValue     = 25;

            PrizeLevels pls = new PrizeLevels();

            pls.addPrizeLevel(pl1);
            pls.addPrizeLevel(pl2);
            pls.addPrizeLevel(pl3);

            DivisionModel dm1 = new DivisionModel();

            dm1.addPrizeLevel(pl1);
            dm1.addPrizeLevel(pl2);

            DivisionModel dm2 = new DivisionModel();

            dm2.addPrizeLevel(pl2);
            dm2.addPrizeLevel(pl3);

            DivisionModel dm3 = new DivisionModel();

            dm3.addPrizeLevel(pl1);
            dm3.addPrizeLevel(pl3);

            DivisionModel dm4 = new DivisionModel();

            dm4.addPrizeLevel(pl2);

            DivisionsModel dms = new DivisionsModel();

            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);

            FileGenerationService fgs = new FileGenerationService();

            fgs.buildGameData(dms, pls, gs, "testBuildGameDataFourDivisionsSixPicks");
        }
示例#12
0
        /// <summary>
        /// Creates new file and writes generated gameplay into it
        /// </summary>
        /// <param name="targetFilePath">Path to the file being written to</param>
        /// <param name="validPath">Valid words list file path</param>
        /// <param name="bannedPath">Banned words list file path</param>
        /// <param name="allModel">Project configuration</param>
        public void CreateGeneratedFile(string targetFilePath, string validPath, string bannedPath, AllModelsModel allModel)
        {
            List <PrizeLevelModel> prizeLevels = new List <PrizeLevelModel>(allModel.PrizeLevelsModel.PrizeLevelList);
            List <DivisionModel>   divisions   = new List <DivisionModel>(allModel.DivisionsModel.DivisionList);
            GameSetupModel         gameModel   = allModel.GameSetupModel;

            PlayGenerator generator = new PlayGenerator(validPath, bannedPath);
            StringBuilder gameplay  = new StringBuilder();

            int        numPermutations = allModel.DivisionsModel.NumPermutations;
            List <int> complexities    = new List <int>();

            LogWriter.GetInstance().WriteLog("Generating complexities");

            // sets complexities for entire generation
            if (!allModel.PrizeLevelsModel.Randomize)
            {
                foreach (PrizeLevelModel currentPrizeLevel in prizeLevels)
                {
                    complexities.Add(currentPrizeLevel.UniqueLetterCount);
                }
                LogWriter.GetInstance().WriteLog("Finished non-random complexities");
            }

            for (int i = 0; i < numPermutations; i++)
            {
                // creates new complexities list for each permutation
                if (allModel.PrizeLevelsModel.Randomize)
                {
                    LogWriter.GetInstance().WriteLog("Generating random complexities");
                    complexities.Clear();
                    WordListManager lists = new WordListManager(validPath, bannedPath, 1, 30);
                    List <int>      potentialComplexities = new List <int>();
                    for (int complexityIndex = lists.GetLeastComplexCount(); complexityIndex < lists.GetMostComplexCount(); complexityIndex++)
                    {
                        if (lists.HasComplexity(complexityIndex))
                        {
                            potentialComplexities.Add(complexityIndex);
                        }
                    }
                    potentialComplexities.Shuffle();

                    foreach (PrizeLevelModel currentPrizeLevel in prizeLevels)
                    {
                        int    seed = (int)((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % Int32.MaxValue);
                        Random rand = new Random(seed);
                        int    nextComplexityIndex = rand.Next(0, potentialComplexities.Count);
                        int    nextComplexityValue = potentialComplexities[nextComplexityIndex];
                        potentialComplexities.Remove(nextComplexityValue);

                        complexities.Add(nextComplexityValue);
                    }
                    LogWriter.GetInstance().WriteLog("Finished randomized complexities");
                }

                LogWriter.GetInstance().WriteLog("Creating WordManager");
                WordManager manager = new WordManager(prizeLevels.Count, complexities, validPath, bannedPath);
                LogWriter.GetInstance().WriteLog("Finished creating WordManager");
                foreach (DivisionModel currentDivision in divisions)
                {
                    LogWriter.GetInstance().WriteLog("Generating gameplay");
                    string winPermutation = generator.GenerateGameplay(prizeLevels, currentDivision, gameModel, complexities, prizeLevels.IndexOf(currentDivision.PrizeLevel), manager, allModel.PrizeLevelsModel.Randomize);
                    gameplay.Append(winPermutation);
                    LogWriter.GetInstance().WriteLog("Finished generating gameplay");
                }
                // lose division
                DivisionModel loss = new DivisionModel(allModel.DivisionsModel);
                loss.Multiplier = 0;
                gameplay.Append(generator.GenerateGameplay(prizeLevels, loss, gameModel, complexities, -1, manager, allModel.PrizeLevelsModel.Randomize));
            }

            File.WriteAllText(targetFilePath, gameplay.ToString());
        }
        public void testBuildGameDataFiveDivisionsNinePicksWithFailDivision()
        {
            GameSetupModel gs = new GameSetupModel();

            gs.maxPermutations = 1000;
            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);

            DivisionModel dm2 = new DivisionModel();

            dm2.addPrizeLevel(pl1);
            dm2.addPrizeLevel(pl2);

            DivisionModel dm3 = new DivisionModel();

            dm3.addPrizeLevel(pl1);
            dm3.addPrizeLevel(pl3);

            DivisionModel dm4 = new DivisionModel();

            dm4.addPrizeLevel(pl2);
            dm4.addPrizeLevel(pl3);

            DivisionModel dm5 = new DivisionModel();

            dm5.addPrizeLevel(pl4);
            dm5.addPrizeLevel(pl5);

            DivisionModel dm6 = new DivisionModel();

            DivisionsModel dms = new DivisionsModel();

            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);
            dms.addDivision(dm5);
            dms.addDivision(dm6);

            FileGenerationService fgs = new FileGenerationService();

            fgs.buildGameData(dms, pls, gs, "testBuildGameDataFiveDivisionsNinePicksWithFail");
        }
 /// <summary>
 /// Sets the data context for the UserControl panel
 /// </summary>
 /// <param name="model">The data context</param>
 public void SetModel(GameSetupModel model)
 {
     _model = model ?? new GameSetupModel();
     DataBind();
 }
        public void testBuildGameDataFourDivisonsFivePicks()
        {
            //Custom input for a game
            GameSetupModel gs = new GameSetupModel();

            gs.maxPermutations = 1000;
            gs.totalPicks      = 5;
            gs.isNearWin       = true;
            gs.nearWins        = 2;

            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;

            PrizeLevel pl4 = new PrizeLevel();

            pl4.isInstantWin   = false;
            pl4.numCollections = 4;
            pl4.prizeValue     = 10000;

            PrizeLevel pl5 = new PrizeLevel();

            pl5.isInstantWin   = false;
            pl5.numCollections = 3;
            pl5.prizeValue     = 1000;

            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);

            DivisionModel dm2 = new DivisionModel();

            dm2.addPrizeLevel(pl2);

            DivisionModel dm3 = new DivisionModel();

            dm3.addPrizeLevel(pl2);
            dm3.addPrizeLevel(pl3);

            DivisionModel dm4 = new DivisionModel();

            dm4.addPrizeLevel(pl5);

            DivisionModel dm5 = new DivisionModel();

            dm5.addPrizeLevel(pl5);
            dm5.addPrizeLevel(pl2);

            DivisionsModel dms = new DivisionsModel();

            dms.addDivision(dm1);
            dms.addDivision(dm2);
            dms.addDivision(dm3);
            dms.addDivision(dm4);
            dms.addDivision(dm5);

            //File Generator
            FileGenerationService fgs = new FileGenerationService();

            fgs.buildGameData(dms, pls, gs, "T:\\Work\\JunkOut\\testBuildGameDataFourDivisonsFivePicks.txt");
        }
示例#16
0
 /// <summary>
 /// Constructor that creates the model data for the client project
 /// </summary>
 public AllModelsModel()
 {
     GameSetupModel   = new GameSetupModel();
     PrizeLevelsModel = new PrizeLevelsModel();
     DivisionsModel   = new DivisionsModel();
 }
示例#17
0
 /// <summary>
 /// Constructs project writer with references to the project models
 /// </summary>
 /// <param name="plModel">PrizeLevels model</param>
 /// <param name="gsuModel">GameSetup model</param>
 /// <param name="divModel">Divisions model</param>
 public ProjectWriter(PrizeLevelsModel plModel, GameSetupModel gsuModel, DivisionsModel divModel)
 {
     project = new AllModelsModel(plModel, gsuModel, divModel);
 }
示例#18
0
 /// <summary>
 /// Constructs a ProjectData object that holds the references to the models of the project
 /// </summary>
 /// <param name="plModel"></param>
 /// <param name="gsuModel"></param>
 /// <param name="divModel"></param>
 public AllModelsModel(PrizeLevelsModel plModel, GameSetupModel gsuModel, DivisionsModel divModel)
 {
     PrizeLevelsModel = plModel;
     GameSetupModel   = gsuModel;
     DivisionsModel   = divModel;
 }
示例#19
0
        /// <summary>
        /// Returns generated gameplay
        /// </summary>
        /// <param name="prizeLevels">The prize levels of the current project configuration</param>
        /// <param name="currentDivision">The division currently being generated</param>
        /// <param name="gameSetup">The game configurations</param>
        /// <returns>String representation of gameplay</returns>
        public string GenerateGameplay(List <PrizeLevelModel> prizeLevels, DivisionModel currentDivision, GameSetupModel gameSetup, List <int> complexities, int prizeLevelIndex, WordManager manager, bool isRandomized)
        {
            StringBuilder gameplay = new StringBuilder();
            List <Word>   wordList = manager.GetWordSet();

            LogWriter.GetInstance().WriteLog("Creating words list");
            foreach (Word currentWord in wordList)
            {
                gameplay.Append(currentWord.ToString());
                gameplay.Append(":").Append((char)('A' + complexities.IndexOf(currentWord.GetComplexity())));
                if (wordList.IndexOf(currentWord) < wordList.Count - 1)
                {
                    gameplay.Append(",");
                }
            }
            gameplay.Append("|");
            LogWriter.GetInstance().WriteLog("Finished creating words list");

            // letter logic goes here
            List <char> callLetters = new List <char>();
            char        terminator  = ' ';

            LogWriter.GetInstance().WriteLog("Determining min/max call letters");
            int minimumNumLetters = -1;
            int maximumNumLetters = -1;

            if (isRandomized)
            {
                int minValue           = Int32.MaxValue;
                int maxCallLetterValue = 0;
                foreach (int complexity in complexities)
                {
                    maxCallLetterValue += complexity;
                    if (complexity < minValue)
                    {
                        minValue = complexity;
                    }
                }

                minimumNumLetters = minValue;
                maximumNumLetters = maxCallLetterValue < 10 ? maxCallLetterValue : 10;
            }
            else
            {
                minimumNumLetters = gameSetup.CallLettersModel.MinCallLetters;
                maximumNumLetters = gameSetup.CallLettersModel.MaxCallLetters;
            }
            LogWriter.GetInstance().WriteLog("Selected min/max call letters");

            int    seed           = (int)((DateTime.Now.Ticks / TimeSpan.TicksPerMillisecond) % Int32.MaxValue);
            Random rand           = new Random(seed);
            int    numCallLetters = rand.Next(minimumNumLetters, maximumNumLetters + 1);

            if (currentDivision.Multiplier == 0)
            {
                LogWriter.GetInstance().WriteLog("Generating loss set");
                callLetters = manager.GetLossSet(numCallLetters, gameSetup.CallLettersModel.NumCallLettersPerRowInHistory);
                terminator  = '*';
                LogWriter.GetInstance().WriteLog("Finished creating loss set");
            }
            else
            {
                LogWriter.GetInstance().WriteLog("Generating win set");
                callLetters = manager.GetWinSet(complexities[prizeLevelIndex], numCallLetters, gameSetup.CallLettersModel.NumCallLettersPerRowInHistory);
                terminator  = currentDivision.Multiplier.ToString().ToCharArray()[0];
                LogWriter.GetInstance().WriteLog("Finished creating win set");
            }

            foreach (char currentLetter in callLetters)
            {
                gameplay.Append(currentLetter).Append(',');
            }
            gameplay.Append(terminator).Append("\n");

            return(gameplay.ToString());
        }
        public async Task PlayGame()
        {
            var firstWordDown       = new WordModel();
            var firstImageDownList  = new List <GameBaseModel>();
            var secondWordDownList  = new List <GameBaseModel>();
            var secondImageDownList = new List <GameBaseModel>();

            using (var client = new HttpClient())
            {
                client.BaseAddress = new Uri("http://passapic.apphb.com/");
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));

                //Game Setup and First Word

                var gameSetup = new GameSetupModel
                {
                    NumberOfPlayers = 4,
                    UserId          = 1
                };

                var response = await client.PostAsJsonAsync("api/game/start", gameSetup);

                if (response.IsSuccessStatusCode)
                {
                    firstWordDown = await response.Content.ReadAsAsync <WordModel>();
                }
                else
                {
                    Assert.Fail();
                }

                //First Image

                var firstImageUp = new ImageModel
                {
                    GameId     = firstWordDown.GameId,
                    NextUserId = 2,
                    Image      = "First Image",
                    UserId     = firstWordDown.UserId
                };
                response = await client.PostAsJsonAsync("api/game/guessimage", firstImageUp);

                if (!response.IsSuccessStatusCode)
                {
                    Assert.Fail();
                }

                response = await client.GetAsync("api/game/guesses/" + firstImageUp.NextUserId);

                if (response.IsSuccessStatusCode)
                {
                    firstImageDownList = await response.Content.ReadAsAsync <List <GameBaseModel> >();
                }
                else
                {
                    Assert.Fail();
                }

                //Second Word

                var secondWordUp = new WordModel()
                {
                    GameId     = firstImageDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.GameId).FirstOrDefault(),
                    NextUserId = 3,
                    Word       = "First Word Up",
                    UserId     = firstImageDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.UserId).FirstOrDefault()
                };
                response = await client.PostAsJsonAsync("api/game/guessword", secondWordUp);

                if (!response.IsSuccessStatusCode)
                {
                    Assert.Fail();
                }

                response = await client.GetAsync("api/game/guesses/" + secondWordUp.NextUserId);

                if (response.IsSuccessStatusCode)
                {
                    secondWordDownList = await response.Content.ReadAsAsync <List <GameBaseModel> >();
                }
                else
                {
                    Assert.Fail();
                }

                //Second Image

                var secondImageUp = new ImageModel
                {
                    GameId     = secondWordDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.GameId).FirstOrDefault(),
                    NextUserId = 4,
                    Image      = "Second Image",
                    UserId     = secondWordDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.UserId).FirstOrDefault()
                };
                response = await client.PostAsJsonAsync("api/game/guessimage", secondImageUp);

                if (!response.IsSuccessStatusCode)
                {
                    Assert.Fail();
                }

                response = await client.GetAsync("api/game/guesses/" + secondImageUp.NextUserId);

                if (response.IsSuccessStatusCode)
                {
                    secondImageDownList = await response.Content.ReadAsAsync <List <GameBaseModel> >();
                }
                else
                {
                    Assert.Fail();
                }

                //Final Word

                var finalWordUp = new WordModel()
                {
                    GameId     = secondImageDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.GameId).FirstOrDefault(),
                    NextUserId = 455,
                    Word       = "final word",
                    UserId     = secondImageDownList.Where(x => x.GameId == firstWordDown.GameId).Select(y => y.UserId).FirstOrDefault()
                };
                response = await client.PostAsJsonAsync("api/game/guessword", finalWordUp);

                if (!response.IsSuccessStatusCode)
                {
                    Assert.Fail();
                }

                //Get Results
                response = await client.GetAsync("api/game/results/1");

                if (response.IsSuccessStatusCode)
                {
                    var games = await response.Content.ReadAsAsync <List <GamesModel> >();
                }


                Assert.IsTrue(true);
            }
        }