public async void RetrieveTopGamesTest() { Total <List <Game> > topGames = await twixel.RetrieveTopGames(); Game league = topGames.wrapped.FirstOrDefault((game) => game.name == "League of Legends"); Assert.NotNull(league); Total <List <Game> > nextGames = await twixel.RetrieveTopGames(25); league = nextGames.wrapped.FirstOrDefault((game) => game.name == "League of Legends"); Assert.Null(league); }
public async void RetrieveTopGamesTest() { List <Game> topGames = await twixel.RetrieveTopGames(false); Game league = null; foreach (Game game in topGames) { if (game.name == "League of Legends") { league = game; break; } } Assert.NotNull(league); List <Game> nextGames = await twixel.RetrieveTopGames(true); league = null; foreach (Game game in nextGames) { if (game.name == "League of Legends") { league = game; break; } } Assert.Null(league); bool eventWasFired = false; twixel.TwixelErrorEvent += (o, e) => eventWasFired = true; List <Game> errorGames = await twixel.RetrieveTopGames(101, false); Assert.True(eventWasFired); }