예제 #1
0
        public async Task TestBrowseTopTracks()
        {
            // Get popular tracks in France
            ContentResponse browseResults = await Client.BrowseAsync(Namespace.music, ContentSource.Catalog, ItemType.Tracks, country : "FR").Log();

            Assert.IsNotNull(browseResults, "The browse response should not be null");
            AssertPaginatedListIsValid(browseResults.Tracks, 25, 100);

            // Get popular pop tracks in the US
            ContentResponse browsePopResults = await Client.BrowseAsync(Namespace.music, ContentSource.Catalog, ItemType.Tracks, genre : "Pop", country : "US").Log();

            Assert.IsNotNull(browsePopResults, "The browse response should not be null");
            AssertPaginatedListIsValid(browsePopResults.Tracks, 25, 100);
        }
예제 #2
0
        public async Task TestPreview()
        {
            // Get popular tracks in Great Britain
            ContentResponse browseResults = await Client.BrowseAsync(Namespace.music, ContentSource.Catalog, ItemType.Tracks, country : "GB").Log();

            Assert.IsNotNull(browseResults, "The browse response should not be null");
            AssertPaginatedListIsValid(browseResults.Tracks, 25, 100);

            // Request a preview stream URL for the first one
            Track          track          = browseResults.Tracks.Items.First();
            StreamResponse streamResponse = await Client.PreviewAsync(track.Id, ClientInstanceId, country : "GB").Log();

            Assert.IsNotNull(streamResponse, "The preview stream URL response should not be null");
            Assert.IsNotNull(streamResponse.Url, "The preview stream URL should not be null");
            Assert.IsNotNull(streamResponse.ContentType, "The preview stream content type should not be null");
        }