public void FullGameInfoTest() { int[] testArray = new int[1] { 0 }; int[] testOtherArray = new int[1] { 0 }; dao.PushGameInfo(999, "CW Mecha", "Enter the weapon that will change Coder Wars forever", testArray, testOtherArray, 0, 0, rtingID); GameInfo test = new GameInfo(); IList <GameInfo> testList = new List <GameInfo>(); testList = dao.PullMuliGameInfo("CW"); test = dao.PullGameInfo("CW Mecha"); Assert.AreEqual(2, testList.Count); Assert.AreEqual(2, dao.CheckGameInfo("CW")); Assert.AreEqual(999, testList[1].game_ID); }
public IList <GameInfo> GetGames(string name, bool gameIsListed = true) { //Returns the number of results found in SQL DB int checkGame = gameInfoSQLDAO.CheckGameInfo(name); IList <GameInfo> getGameList = new List <GameInfo>(); //if the games that are listed are not what the user is looking for or if the SQL DB does not return anything, it will then pull from IGDB if (gameIsListed = true && checkGame != 0) { getGameList = gameInfoSQLDAO.PullMuliGameInfo(name); } else { //Gets game list from IGDB and adds any missing games to SQL DB getGameList = gameInfoIGDBDAO.PullMuliGameInfo(name); PushCoversIntoSQL(getGameList); PushFranchiseIntoSQL(getGameList); PushGameInfoToSQL(getGameList); } return(getGameList); }