Esempio n. 1
0
        public async Task IndexTest()
        {
            var res1 = await Tracklist.Clear();

            Assert.True(res1);

            var res2 = await Library.Search(
                queryArtist : "Air Supply",
                queryAlbum : "Strangers In Love"
                );

            Assert.True(res2.Succeeded);
            Assert.True(1 <= res2.Result.Length);
            Assert.True(1 <= res2.Result.First().Tracks.Length);
            var uris = res2.Result.First().Tracks
                       .OrderBy(e => e.TrackNo)
                       .Select(e => e.Uri)
                       .ToArray();

            var res3 = await Tracklist.Add(uris);

            Assert.True(res3.Succeeded);

            var res4 = await Tracklist.GetTlTracks();

            Assert.True(res4.Succeeded);
            Assert.Equal(uris.Length, res4.Result.Length);

            for (var i = 0; i < uris.Length; i++)
            {
                var res5 = await Tracklist.Index(tlId : res4.Result[i].TlId);

                Assert.Equal(uris[(int)res5.Result], res4.Result[i].Track.Uri);
            }
        }