public void prepends_the_authentication_node() { var thePolicy = new ApplyAuthenticationPolicy(); var chain = chainFor <TestAuthenticationEndpoint <AuthenticatedModel> >(x => x.get_something(null)); var graph = new BehaviorGraph(); graph.AddChain(chain); thePolicy.Configure(graph); chain.First().ShouldBeOfType <AuthenticationFilterNode>(); }
public void uses_the_filter() { var thePolicy = new ApplyAuthenticationPolicy(); var chain = chainFor <TestAuthenticationEndpoint <AuthenticatedModel> >(x => x.get_something(null)); var graph = new BehaviorGraph(); graph.AddChain(chain); // This is the filter set up that will explicitly exclude this chain graph.Settings.Get <AuthenticationSettings>().ExcludeChains.InputTypeIs <AuthenticatedModel>(); thePolicy.Configure(graph); chain.ShouldHaveTheSameElementsAs(chain.FirstCall()); }