Example #1
0
        public async Task TestGetCredentials()
        {
            var actual = await yandexCredentials.GetAuthorizationInfoAsync();

            Assert.IsNotEmpty(actual.Token);
            Assert.IsNotEmpty(actual.Uid);
            Assert.True(actual.ExpirationDate > DateTime.Now);
        }
Example #2
0
        public async Task <Playlist[]> GetPlaylistsAsync(string userId)
        {
            var authorizationInfo = await yandexCredentials.GetAuthorizationInfoAsync().ConfigureAwait(false);

            var realUserId = userId ?? authorizationInfo.Uid;

            var result = await DoRequestAsync <Playlist[]>($"users/{realUserId}/playlists/list")
                         .ConfigureAwait(false);

            return(result.Resilt);
        }