private static async Task Main() { _options = new TheMovieDatabaseOptions("your-api-key", "en"); _service = new TheMovieDatabaseService(_httpClient, _options); await InitializeMenu(); }
public void ShouldThrowExceptionWhenHttpClientIsNull() { var options = new TheMovieDatabaseOptions(); Assert.Throws <ArgumentNullException>(() => { var service = new TheMovieDatabaseService(null, options); }); }
public void ShouldThrowExceptionWhenApiKeyIsNullOrWhiteSpace() { var options = new TheMovieDatabaseOptions { ApiKey = null, }; Assert.Throws <ArgumentException>(() => { var service = new TheMovieDatabaseService(_httpClient, options); }); }
public void ShouldThrowExceptionWhenImageAddressIsNullOrWhiteSpace() { var options = new TheMovieDatabaseOptions { ImageAddress = null, ApiKey = "something", ApiAddress = "something", }; Assert.Throws <ArgumentException>(() => { var service = new TheMovieDatabaseService(_httpClient, options); }); }