Esempio n. 1
0
        public async Task GetTracks_TrackIdsMarket_AvailableMarketsIsNull()
        {
            // arrange
            string[] trackIds = new[] { "5lA3pwMkBdd24StM90QrNR", "20I6sIOMTCkB6w7ryavxtO", "7xGfFoTpQ2E7fRF5lN10tr" };

            var http     = new HttpClient();
            var accounts = new AccountsService(http, TestsHelper.GetLocalConfig());
            var api      = new TracksApi(http, accounts);

            // act
            var response = await api.GetTracks(trackIds, SpotifyCountryCodes.New_Zealand);

            // assert
            Assert.IsNull(response[0].AvailableMarkets);
        }
Esempio n. 2
0
        public async Task GetTracks_TrackIdsNoMarket_MarketsArrayPopulated()
        {
            // arrange
            string[] trackIds = new[] { "5lA3pwMkBdd24StM90QrNR", "20I6sIOMTCkB6w7ryavxtO", "7xGfFoTpQ2E7fRF5lN10tr" };

            var http     = new HttpClient();
            var accounts = new AccountsService(http, TestsHelper.GetLocalConfig());

            var api = new TracksApi(http, accounts);

            // act
            var response = await api.GetTracks(trackIds);

            // assert
            Assert.IsTrue(response[0].AvailableMarkets.Length > 0);
        }
Esempio n. 3
0
        public async Task GetTracks_TrackIds_CorrectTrackNames()
        {
            // arrange
            string[] trackIds = new[] { "11dFghVXANMlKmJXsNCbNl", "20I6sIOMTCkB6w7ryavxtO", "7xGfFoTpQ2E7fRF5lN10tr" };

            var http     = new HttpClient();
            var accounts = new AccountsService(http, TestsHelper.GetLocalConfig());

            var api = new TracksApi(http, accounts);

            // act
            var response = await api.GetTracks(trackIds);

            // assert
            Assert.AreEqual("Cut To The Feeling", response[0].Name);
            Assert.AreEqual("Call Me Maybe", response[1].Name);
            Assert.AreEqual("Run Away With Me", response[2].Name);
        }