Example #1
0
        public void MainController_IntialiseNewGame()
        {
            //FileReadWriter frw = new FileReadWriter();
            //frw.WriteSaveDataFile("eventCatalogue", gs.GetEM().ParseCatalogueToString());
            //frw.WriteSaveDataFile("itemCatalogue", gs.GetPCM().GetItemCatalogue().ParseToString());
            //frw.WriteSaveDataFile("discoveryCatalogue", gs.GetDM().ParseCatalogueToString());

            MainController mc = new MainController();

            //Assert.IsTrue(mc.InitialiseNewGame(), "New game should be succesfully initialized");
            mc.InitialiseNewGame();
            GameState workingGS = mc.GetGameState();

            PCModel        workingPCM = workingGS.GetPCM();
            LocationModel  workingLM  = workingGS.GetLM();
            EventModel     workingEM  = workingGS.GetEM();
            DiscoveryModel workingDM  = workingGS.GetDM();

            EventCatalogue ec = workingEM.GetEventCatalogue();

            String workingEventCat = workingEM.ParseCatalogueToString();
            String workingDiscCat  = workingDM.ParseCatalogueToString();
            String workingItemCat  = workingPCM.GetItemCatalogue().ParseToString();

            Assert.AreEqual(eventCatalogue, workingEventCat, "Event catalogues should match");
            Assert.AreEqual(discoveryCatalogue, workingDiscCat, "Discovery catalogues should match");
            Assert.AreEqual(itemCatalogue, workingItemCat, "Item catalogues should match");
            Assert.AreEqual(512, workingLM.GetUnvisited().Count, "Should be 1024 unvisited nodes");
        }