Пример #1
0
 public RegistrationLoggingBehavior(
     IContainer container,
     IBehaviorChain behaviorChainChain, Logger logger,
     HttpRequestMessage requestMessage,
     HttpResponseMessage responseMessage,
     HttpResponseHeaders responseHeaders,
     HttpConfiguration httpConfiguration,
     HttpRequestContext httpRequestContext,
     ActionDescriptor actionDescriptor,
     ActionMethod actionMethod,
     RouteDescriptor routeDescriptor,
     RequestCancellation requestCancellation,
     UrlParameters urlParameters,
     QuerystringParameters querystringParameters,
     SomeType someInstance)
 {
     BehaviorChain = behaviorChainChain;
     logger.Write(container);
     logger.Write(requestMessage);
     logger.Write(responseMessage);
     logger.Write(responseHeaders);
     logger.Write(actionMethod);
     logger.Write(actionDescriptor);
     logger.Write(routeDescriptor);
     logger.Write(httpRequestContext);
     logger.Write(httpConfiguration);
     logger.Write(requestCancellation);
     logger.Write(urlParameters);
     logger.Write(querystringParameters);
     logger.Write(someInstance);
 }
 public AuthenticationBehavior(IBehaviorChain behaviorChain,
                               HttpRequestMessage requestMessage,
                               HttpResponseMessage responseMessage,
                               List <IAuthenticator> authenticators,
                               Configuration configuration,
                               ActionDescriptor actionDescriptor) :
     base(behaviorChain)
 {
     _requestMessage   = requestMessage;
     _responseMessage  = responseMessage;
     _authenticators   = authenticators;
     _configuration    = configuration;
     _actionDescriptor = actionDescriptor;
 }
Пример #3
0
 public CorsBehavior(IBehaviorChain behaviorChain,
                     ICorsEngine corsEngine, CorsConfiguration corsConfiguration,
                     ActionDescriptor actionDescriptor, HttpRequestMessage requestMessage,
                     IEnumerable <ICorsPolicySource> policySources, Configuration configuration,
                     HttpConfiguration httpConfiguration) : base(behaviorChain)
 {
     _configuration     = configuration;
     _httpConfiguration = httpConfiguration;
     _corsEngine        = corsEngine;
     _corsConfiguration = corsConfiguration;
     _actionDescriptor  = actionDescriptor;
     _requestMessage    = requestMessage;
     _policySources     = policySources;
 }
Пример #4
0
 public void Setup()
 {
     _authenticators           = new List <IAuthenticator>();
     _basicAuthenticator       = new TestBasicAuthenticator("fark", "farker");
     _bearerTokenAuthenticator = new TestBearerTokenAuthenticator("fark");
     _configuration            = new Configuration();
     _requestMessage           = new HttpRequestMessage();
     _responseMessage          = new HttpResponseMessage(HttpStatusCode.OK);
     _behaviorChain            = Substitute.For <IBehaviorChain>();
     _behaviorChain.InvokeNext().Returns(_responseMessage);
     _actionDescriptor = new ActionDescriptorFactory(_configuration, null, new TypeCache())
                         .CreateDescriptor(null, null);
     _behavior = new AuthenticationBehavior(_behaviorChain, _requestMessage,
                                            _responseMessage, _authenticators, _configuration, _actionDescriptor);
 }
Пример #5
0
 public void Setup()
 {
     _configuration     = new Configuration();
     _corsEngine        = new CorsEngine();
     _corsConfiguration = new CorsConfiguration();
     _actionDescriptor  = new ActionDescriptor(ActionMethod.From <Handler>(x => x.Get()),
                                               null, null, null, null, null, null, null, new TypeCache());
     _innerResponse = new HttpResponseMessage();
     _behaviorChain = Substitute.For <IBehaviorChain>();
     _behaviorChain.InvokeNext().Returns(_innerResponse);
     _requestMessage = new HttpRequestMessage();
     _requestMessage.Headers.Host = "yourmom.com";
     _requestMessage.Properties.Add(HttpPropertyKeys.HttpConfigurationKey, new HttpConfiguration());
     _policySources = new List <ICorsPolicySource>();
     _behavior      = new CorsBehavior(_behaviorChain, _corsEngine, _corsConfiguration,
                                       _actionDescriptor, _requestMessage, _policySources, _configuration, null);
 }
Пример #6
0
 protected BehaviorBase(IBehaviorChain behaviorChain)
 {
     BehaviorChain = behaviorChain;
 }
Пример #7
0
 public TestDoesentApplyBehavior(IBehaviorChain behaviorChain) : base(behaviorChain)
 {
 }
Пример #8
0
 public TestBehavior2(IBehaviorChain behaviorChain, Logger logger) :
     base(behaviorChain, logger)
 {
 }
Пример #9
0
 protected TestBehaviorBase(IBehaviorChain behaviorChain, Logger logger) : base(logger)
 {
     _behaviorChain = behaviorChain;
 }
Пример #10
0
 public Behavior1(IBehaviorChain behaviorChain) : base(behaviorChain)
 {
 }
Пример #11
0
 public ShouldNotRunBehavior(IBehaviorChain behaviorChain, Logger logger)
 {
     Logger        = logger;
     BehaviorChain = behaviorChain;
     ShouldRunFlag = false;
 }
Пример #12
0
 public Behavior3(IBehaviorChain behaviorChain, Logger logger)
 {
     Logger        = logger;
     BehaviorChain = behaviorChain;
 }
Пример #13
0
 public DisposableBehavior(IBehaviorChain behaviorChain, Disposable disposable)
 {
     BehaviorChain = behaviorChain;
 }