public void SelectValidCategory() { foreach (SlideCategories cat in allCategories) { startMenuDataContext.SelectedCategory = (int)cat; startMenuDataContext.StartNewGame(); currDataContext = mainWindow.DataContext; //Make sure the DataContext correctly changed to a GameViewModel Assert.IsTrue(CheckType(currDataContext, typeof(GameViewModel)), "Expected DataContext to become a GameViewModel, but it did not."); } }