Exemplo n.º 1
0
 public async Task GetCurrentWeatherAsync_IfApiKeyEmptyOrNull_ThrowArgumentException()
 {
     _sut        = OpenWeatherProcessor.Instance;
     _sut.ApiKey = null;
     //_sut.ApiKey = "";
     await Assert.ThrowsAsync <ArgumentException>(() => _sut.GetCurrentWeatherAsync());
 }
 public OpenWeatherService(string apiKey)
 {
     owp        = OpenWeatherProcessor.Instance;
     owp.ApiKey = apiKey;
 }
Exemplo n.º 3
0
 public async Task GetCurrentWeatherAsync_IfApiHelperNotInitialized_ThrowArgumentException()
 {
     _sut = OpenWeatherProcessor.Instance;
     ApiHelper.ApiClient = null;
     await Assert.ThrowsAsync <ArgumentException>(() => _sut.GetCurrentWeatherAsync());
 }
Exemplo n.º 4
0
 public async Task GetOneCallAsync_IfApiHelperNotInitialized_ThrowArgumentException()
 {
     _sut = OpenWeatherProcessor.Instance;
     await Assert.ThrowsAsync <ArgumentException>(() => _sut.GetOneCallAsync());
 }
Exemplo n.º 5
0
 public async Task GetOneCallAsync_IfApiKeyEmptyOrNull_ThrowArgumentException()
 {
     _sut = OpenWeatherProcessor.Instance;
     await Assert.ThrowsAsync <ArgumentException>(() => _sut.GetOneCallAsync());
 }
 public OpenWeatherService(string apiKey)
 {
     LastTemp   = new TemperatureModel();
     owp        = OpenWeatherProcessor.Instance;
     owp.ApiKey = apiKey;
 }