public void TestLoadGamesByGenreWithoutResults() { bool loadComplete = false; GamesViewModel viewModel = new GamesViewModel(new MockGameCatalog()); viewModel.LoadComplete += (s, e) => { loadComplete = true; }; viewModel.LoadGamesByGenre("Mature"); // Non-existent Genre EnqueueConditional(() => loadComplete); EnqueueCallback(() => { Assert.AreNotEqual(viewModel.Games, null, "Expected games list not to be null."); }); EnqueueCallback(() => { Assert.IsTrue(viewModel.Games.Count == 0, "Expected games list have no results."); }); EnqueueTestComplete(); }
void LoadGames(string genre) { loadingBar.Visibility = Visibility.Visible; if (genre == "(All)") { viewModel.LoadGames(); } else { viewModel.LoadGamesByGenre(genre); } }