Exemple #1
0
        public async Task EnsureCountryResolverPassesDefaultSettings()
        {
            MockApiRequestHandler mockHandler = new MockApiRequestHandler(Resources.country);
            ICountryResolver      client      = new CountryResolver("test1", mockHandler);
            bool result = await client.CheckAvailabilityAsync("xx");

            Assert.AreEqual("test1", mockHandler.LastUsedSettings.ClientId);
            Assert.AreEqual(null, mockHandler.LastUsedSettings.CountryCode);
            Assert.AreEqual(false, mockHandler.LastUsedSettings.CountryCodeBasedOnRegionInfo);
            Assert.AreEqual(MusicClientCommand.DefaultBaseApiUri, mockHandler.LastUsedSettings.ApiBaseUrl);
            Assert.AreEqual(MusicClientCommand.DefaultSecureBaseApiUri, mockHandler.LastUsedSettings.SecureApiBaseUrl);
        }
Exemple #2
0
 public async Task EnsureCountryWithoutItemsRaisesApiCallFailedException()
 {
     MockApiRequestHandler mockHandler = new MockApiRequestHandler(System.Text.Encoding.UTF8.GetBytes("{ \"items\": [] }"));
     ICountryResolver      client      = new CountryResolver("test1", mockHandler);
     bool result = await client.CheckAvailabilityAsync("xx");
 }