Beispiel #1
0
        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);
        }
Beispiel #2
0
        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);
        }