コード例 #1
0
        public void StoryModel_Set_Active_Story_Test()
        {
            //Fetch stories and get the first one from the list
            Story initialStory = GetStories()[0];
            Story newStory     = GetStories()[1];

            //Create a new StoryModel
            new StoryModel(initialStory);
            //Test that the Instance gets initialized properly
            StoryModel storyModel = StoryModel.GetInstance();

            //Change active story in Model
            storyModel.SetActiveStory(newStory);

            //Fetch a list of locations from the model
            List <Location> modelLocations = storyModel.GetStoryLocations();

            //Iterate through the locations fetched from Model
            int i = 0;

            foreach (var location in modelLocations)
            {
                //Check that all locations match
                Assert.AreSame(newStory.locations[i], modelLocations[i]);
                i++;
            }
        }