コード例 #1
0
        public void Constructor_ApiKeyInGoodreadsSettingsIsNotNullOrWhiteSpaces_ServiceConstructed()
        {
            _goodreadsSettings.ApiKey = _validApiKey;

            Assert.DoesNotThrow(() =>
            {
                var goodreadsService = new GoodreadsService(
                    Mock.Of <HttpClient>(),
                    new OptionsWrapper <GoodreadsSettings>(_goodreadsSettings));
            });
        }
コード例 #2
0
        public void Constructor_ApiKeyIsNullOrWhiteSpaces_ThrowsArgumentException(string apiKey)
        {
            _goodreadsSettings.ApiKey = apiKey;

            Assert.Throws <Exception>(
                () =>
            {
                var goodreadsService = new GoodreadsService(
                    Mock.Of <HttpClient>(),
                    new OptionsWrapper <GoodreadsSettings>(_goodreadsSettings));
            });
        }