mirror of
https://github.com/Sarsoo/IF.Lastfm.git
synced 2024-10-16 23:13:07 +01:00
Integration test for UserGetWeeklyArtistChart
This commit is contained in:
parent
695d318aaa
commit
6806ea4b9d
@ -0,0 +1,32 @@
|
||||
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 UserGetWeeklyArtistChartTests : CommandIntegrationTestsBase
|
||||
{
|
||||
[Test]
|
||||
public async Task GetChartList_Success()
|
||||
{
|
||||
//call GetWeeklyChartList to get available weeks
|
||||
var weekList = await Lastfm.User.GetWeeklyChartListAsync(INTEGRATION_TEST_USER);
|
||||
var from = weekList.Content.Last().From;
|
||||
var to = weekList.Content.Last().To;
|
||||
//use the from and to params to call GetWeeklyArtistChart for the last week
|
||||
var response = await Lastfm.User.GetWeeklyArtistChartAsync(INTEGRATION_TEST_USER, from, to);
|
||||
var artistChart = response.Content;
|
||||
|
||||
Assert.IsTrue(response.Success);
|
||||
|
||||
//Values will vary from week to week so just checking that we got some values back
|
||||
Assert.IsNotEmpty(artistChart);
|
||||
Assert.IsNotEmpty(artistChart.First().Name);
|
||||
Assert.IsNotNull(response.From);
|
||||
Assert.IsNotNull(response.To);
|
||||
}
|
||||
}
|
||||
}
|
@ -94,8 +94,8 @@ public async Task GetWeeklyArtistChart_HandleResponse_Success()
|
||||
Assert.AreEqual("2437980f-513a-44fc-80f1-b90d9d7fcf8f", first.Mbid);
|
||||
Assert.AreEqual(18, first.PlayCount);
|
||||
Assert.AreEqual(new Uri("https://www.last.fm/music/Bing+Crosby"), first.Url);
|
||||
//TODO add this attribute to LastArtist class
|
||||
//Assert.AreEqual(1, first.Weeklyrank);
|
||||
//TODO add rank attribute to LastArtist class
|
||||
//Assert.AreEqual(1, first.Rank);
|
||||
|
||||
//Tests on attribute values
|
||||
Assert.AreEqual((double)1545566400, parsed.From);
|
||||
|
Loading…
Reference in New Issue
Block a user