/// <summary>Constructor</summary> /// <param name="client">Spotify Sdk Client</param> /// <param name="playlistId">Spotify Playlist Id</param> public PlaylistPageViewModel(ISpotifySdkClient client, string playlistId) : base(client, playlistId) { // Values PlaylistItems = new ListPlaylistItemViewModel(client, playlistId); // Command Actions client.CommandActions.Track = (item) => NavigatePage(item); client.CommandActions.Album = (item) => NavigatePage(item); client.CommandActions.Artist = (item) => NavigatePage(item); client.CommandActions.Playlist = (item) => NavigatePage(item); client.CommandActions.User = (item) => NavigatePage(item); client.CommandActions.SetPlaylistImage = (item) => SetPlaylistImage(item); client.CommandActions.SetPlaylist = (item) => SetPlaylist(item); client.CommandActions.RemovePlaylistItem = (item) => PlaylistItems.Remove(item); ClearPlaylistCommand = new GenericCommand <PlaylistResponse>(ClearPlaylist); // Events PlaylistItems.ResponseRemoved += (object sender, ResponseRemovedArgs <PlaylistItemResponse> e) => { client.PlaylistItemResponseRemovedHandler(Item, e); }; PlaylistItems.ResponseMoved += (object sender, ResponseMovedArgs e) => { client.PlaylistItemResponseMovedHandler(Item, e); }; }
public async Task ListPlaylistItemViewModel_Test(string id) { // Arrange var model = new ListPlaylistItemViewModel(_client, id); // Act await((ISupportIncrementalLoading)model.Collection).LoadMoreItemsAsync(count); // Assert Assert.IsTrue(model.Collection.Count > 0); }