Beispiel #1
0
        private static async Task Main()
        {
            _options = new TheMovieDatabaseOptions("your-api-key", "en");
            _service = new TheMovieDatabaseService(_httpClient, _options);

            await InitializeMenu();
        }
Beispiel #2
0
        public void ShouldThrowExceptionWhenHttpClientIsNull()
        {
            var options = new TheMovieDatabaseOptions();

            Assert.Throws <ArgumentNullException>(() =>
            {
                var service = new TheMovieDatabaseService(null, options);
            });
        }
Beispiel #3
0
        public void ShouldThrowExceptionWhenApiKeyIsNullOrWhiteSpace()
        {
            var options = new TheMovieDatabaseOptions
            {
                ApiKey = null,
            };

            Assert.Throws <ArgumentException>(() =>
            {
                var service = new TheMovieDatabaseService(_httpClient, options);
            });
        }
Beispiel #4
0
        public void ShouldThrowExceptionWhenImageAddressIsNullOrWhiteSpace()
        {
            var options = new TheMovieDatabaseOptions
            {
                ImageAddress = null,
                ApiKey       = "something",
                ApiAddress   = "something",
            };

            Assert.Throws <ArgumentException>(() =>
            {
                var service = new TheMovieDatabaseService(_httpClient, options);
            });
        }