public async Task NoAuthentication(WebhookConfig config)
        {
            var factory = new AuthenticationHandlerFactory(new HttpClientFactory(), new Mock <IBigBrother>().Object);

            var handler = await factory.GetAsync(config, CancellationToken.None);

            Assert.Null(handler);
        }
        public async Task GetTokenProvider(WebhookConfig config, IAuthenticationHandler expectedHandler)
        {
            var factory = new AuthenticationHandlerFactory(new HttpClientFactory(), new Mock <IBigBrother>().Object);

            var handler = await factory.GetAsync(config, CancellationToken.None);

            Assert.Equal(expectedHandler.GetType(), handler.GetType());
        }
        public void NoAuthentication(string configurationName, AuthenticationConfig authenticationConfig)
        {
            var indexedDictionary = new IndexDictionary <string, WebhookConfig>
            {
                {
                    configurationName, new WebhookConfig
                    {
                        Name = configurationName,
                        AuthenticationConfig = authenticationConfig
                    }
                }
            };

            var factory = new AuthenticationHandlerFactory(indexedDictionary, new Mock <IBigBrother>().Object);

            var handler = factory.Get(configurationName);

            Assert.Null(handler);
        }
        public void GetTokenProvider(string configurationName, AuthenticationConfig authenticationConfig, IAcquireTokenHandler expectedHandler)
        {
            var indexedDictionary = new IndexDictionary <string, WebhookConfig>
            {
                {
                    configurationName, new WebhookConfig
                    {
                        Name = configurationName,
                        AuthenticationConfig = authenticationConfig
                    }
                }
            };

            var factory = new AuthenticationHandlerFactory(indexedDictionary, new Mock <IBigBrother>().Object);

            var handler = factory.Get(configurationName);

            Assert.Equal(expectedHandler.GetType(), handler.GetType());
        }