public async void FetchToplistAsync_ReturnsRightInformations() { var toplist = await api.FetchToplistAsync(); var first = toplist.FirstOrDefault(); var last = toplist.LastOrDefault(); Assert.NotEmpty(toplist); Assert.Equal(10, toplist.Count); Assert.True(first.TopPlayerScore > last.TopPlayerScore); }
public async Task TopList(string region = null) { var toplist = await _api.FetchToplistAsync(region); if (toplist is null || toplist.Count == 0) { throw new NullReferenceException("Can't fetch the toplist."); } var result = Tabularize(toplist); await ReplyAsync(result); }