public async Task <PageResponse <LastAlbum> > GetTopAlbums(string username, LastStatsTimeSpan span, int pagenumber = 0, int count = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, username, span) { Page = pagenumber, Count = count }; return(await command.ExecuteAsync()); }
public async Task <PageResponse <LastAlbum> > GetTopAlbumsForArtistAsync(string artist, bool autocorrect = false, int page = 1, int itemsPerPage = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, artist) { Page = page, Count = itemsPerPage }; return(await command.ExecuteAsync()); }
public async Task<PageResponse<LastAlbum>> GetTopAlbumsAsync(string artist, bool autocorrect = false, int page = 1, int itemsPerPage = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, artist) { Page = page, Count = itemsPerPage, HttpClient = HttpClient }; return await command.ExecuteAsync(); }
/// <summary> /// Get the top albums tagged by this tag, ordered by tag count. /// </summary> public Task <PageResponse <LastAlbum> > GetTopAlbumsAsync(string tagName, int page = 1, int itemsPerPage = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, tagName) { HttpClient = HttpClient, Page = page, Count = itemsPerPage }; return(command.ExecuteAsync()); }
public void TestInitialise() { _mockAuth = new Mock <ILastAuth>(); _command = new GetTopAlbumsCommand(_mockAuth.Object, USER, SPAN) { Page = 5, Count = 20 }; _command.SetParameters(); }
public void TestInitialise() { _mockAuth = new Mock<ILastAuth>(); _command = new GetTopAlbumsCommand(_mockAuth.Object, USER, SPAN) { Page = 5, Count = 20 }; _command.SetParameters(); }
public async Task HandleErrorResponse() { var command = new GetTopAlbumsCommand(MAuth.Object, "errorTag"); var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetTopAlbumsError)); var parsed = await command.HandleResponse(response); Assert.IsFalse(parsed.Success); Assert.IsTrue(parsed.Status == LastResponseStatus.MissingParameters); }
public void Initialise() { _commandArtist = new GetTopAlbumsCommand(MAuth.Object) { ArtistName = "Steely Dan" }; _commandMbid = new GetTopAlbumsCommand(MAuth.Object) { ArtistMbid = "e01c3376-15fa-40d7-b747-5f219bdefdd7" }; }
public async Task<PageResponse<LastAlbum>> GetTopAlbums(string username, LastStatsTimeSpan span, int pagenumber = 0, int count = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, username, span) { Page = pagenumber, Count = count, HttpClient = HttpClient }; return await command.ExecuteAsync(); }
/// <summary> /// Get the top albums tagged by this tag, ordered by tag count. /// </summary> public Task<PageResponse<LastAlbum>> GetTopAlbumsAsync(string tagName, int page=1, int itemsPerPage= LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth, tagName) { HttpClient = HttpClient, Page = page, Count = itemsPerPage }; return command.ExecuteAsync(); }
public async Task <PageResponse <LastAlbum> > GetTopAlbumsByMbidAsync(string mbid, bool autocorrect = false, int page = 1, int itemsPerPage = LastFm.DefaultPageLength) { var command = new GetTopAlbumsCommand(Auth) { ArtistMbid = mbid, Page = page, Count = itemsPerPage, HttpClient = HttpClient }; return(await command.ExecuteAsync()); }
public async Task HandleSuccessResponse() { //Arrange GetTopAlbumsCommand command = new GetTopAlbumsCommand(MAuth.Object, "disco"); //Act var response = CreateResponseMessage(Encoding.UTF8.GetString(TagApiResponses.GetTopAlbumsSuccess)); var parsed = await command.HandleResponse(response); //Assert Assert.IsTrue(parsed.Success); Assert.IsNotNull(parsed.Content); }