Ejemplo n.º 1
0
        public void Setup()
        {
            _requestGraph = RequestGraph.Create();

            _actionDescriptorFactory = new ActionDescriptorFactory(
                _requestGraph.Configuration, _requestGraph.HttpConfiguration,
                new TypeCache());
        }
Ejemplo n.º 2
0
 public DiagnosticsActionSource(Configuration configuration,
                                HttpConfiguration httpConfiguration, ITypeCache typeCache,
                                DefaultInlineConstraintBuilder constraintBuilder,
                                ActionDescriptorFactory actionDescriptorFactory)
 {
     _configuration           = configuration;
     _httpConfiguration       = httpConfiguration;
     _typeCache               = typeCache;
     _constraintBuilder       = constraintBuilder;
     _actionDescriptorFactory = actionDescriptorFactory;
 }
Ejemplo n.º 3
0
        public void Should_exclude_diagnostics_pages_if_configured(
            [Values(true, false)] bool excludeDiagnostics)
        {
            var actionDescriptor = new ActionDescriptorFactory(_configuration, null, new TypeCache())
                                   .CreateDescriptor(ActionMethod.From <GraphiteHandler>(x => x.Post()), null);
            var behavior = new AuthenticationBehavior(_behaviorChain, _requestMessage,
                                                      _responseMessage, _authenticators, _configuration, actionDescriptor);

            _configuration.ExcludeDiagnosticsFromAuthentication = excludeDiagnostics;

            behavior.ShouldRun().ShouldEqual(!excludeDiagnostics);
        }