示例#1
0
        public async Task Test_BatchTracks_Fetch()
        {
            var tracks = await _client.GetTracksAsync(new string[] { "2WDffjRjjtxHcHCHkLpB5p", "20PISOo4VbLz4yFH78Zv5R" });

            Assert.IsNotNull(tracks);

            var track0 = tracks[0];

            Assert.IsNotNull(track0);
            Assert.AreEqual("2WDffjRjjtxHcHCHkLpB5p", track0.Id.Id);
            Assert.AreEqual("Queen Of The Night", track0.Name);

            Assert.AreEqual("Queen Of The Night", track0.Album.Name);
            Assert.AreEqual("1BWJHMlxzPea13xJIgVxg0", track0.Album.Id.Id);

            Assert.AreEqual("Hey Violet", track0.Artists[0].Name);
            Assert.AreEqual("4JNfz6aO9ZFz0gp5GY88am", track0.Artists[0].Id.Id);

            Assert.AreEqual(1, track0.TrackNumber);
            Assert.AreEqual(TimeSpan.FromSeconds(197.497), track0.Duration);

            Assert.IsTrue(track0.HasExplicitLyrics);

            var track1 = tracks[1];

            Assert.IsNotNull(track1);
            Assert.AreEqual("20PISOo4VbLz4yFH78Zv5R", track1.Id.Id);
            Assert.AreEqual("Swim", track1.Name);

            Assert.AreEqual("You Are Someone Else", track1.Album.Name);
            Assert.AreEqual("7LdUzhm4SloDil5y0sRen0", track1.Album.Id.Id);

            Assert.AreEqual("Fickle Friends", track1.Artists[0].Name);
            Assert.AreEqual("1nhSLEYdoBHG6cJ8NDwoF1", track1.Artists[0].Id.Id);

            Assert.AreEqual(3, track1.TrackNumber);
            Assert.AreEqual(TimeSpan.FromSeconds(197.506), track1.Duration);

            Assert.IsFalse(track1.HasExplicitLyrics);
        }