Changed method name, added integration test

This commit is contained in:
Johan Klinge 2019-01-08 15:35:26 +01:00
parent 628adbe68d
commit 45563553ee
3 changed files with 25 additions and 2 deletions

View File

@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NUnit.Framework;
namespace IF.Lastfm.Core.Tests.Integration.Commands
{
public class UserGetWeeklyChartTests : CommandIntegrationTestsBase
{
[Test]
public async Task GetChartList_Success()
{
var response = await Lastfm.User.GetWeeklyChartListAsync(INTEGRATION_TEST_USER);
var chartlist = response.Content;
Assert.IsTrue(response.Success);
Assert.IsNotEmpty(chartlist);
Assert.That(chartlist.Last().ToDate, Is.EqualTo(DateTime.Now).Within(8).Days);
}
}
}

View File

@ -40,6 +40,6 @@ Task<PageResponse<LastShout>> GetShoutsAsync(string username,
Task<PageResponse<LastTrack>> GetLovedTracks(string username, int pagenumber, int count);
Task<PageResponse<LastWeeklyChartList>> GetWeeklyChartList(string username);
Task<PageResponse<LastWeeklyChartList>> GetWeeklyChartListAsync(string username);
}
}

View File

@ -132,7 +132,7 @@ public async Task<PageResponse<LastTrack>> GetLovedTracks(
};
return await command.ExecuteAsync();
}
public async Task<PageResponse<LastWeeklyChartList>> GetWeeklyChartList(string username)
public async Task<PageResponse<LastWeeklyChartList>> GetWeeklyChartListAsync(string username)
{
var command = new GetWeeklyChartsCommand(auth: Auth, username: username)
{