public JessModule(string basePath = null) { Routes = new List<JessicaRoute>(); Before = new BeforeFilters(); After = new AfterFilters(); _basePath = basePath ?? string.Empty; }
public void PlusEquals_WithFilter_ShouldAddToEndOfList() { Action<RequestContext> filter1 = context => { }; Action<RequestContext> filter2 = context => { }; _filters.AddFilterToEnd(filter2); _filters += filter1; Assert.That(filter1, Is.SameAs(_filters.Filters.Last())); }
public void PlusEquals_WithFilter_ShouldAddToEndOfList() { Action <RequestContext> filter1 = context => { }; Action <RequestContext> filter2 = context => { }; _filters.AddFilterToEnd(filter2); _filters += filter1; Assert.That(filter1, Is.SameAs(_filters.Filters.Last())); }
public void Invoke_WithTwoFilters_ShouldCallAllItems() { var filter1Called = false; var filter2Called = false; Action<RequestContext> filter1 = context => { filter1Called = true; }; Action<RequestContext> filter2 = context => { filter2Called = true; }; _filters += filter1; _filters += filter2; _filters.Invoke(null); Assert.That(filter1Called, Is.True); Assert.That(filter2Called, Is.True); }
public void Invoke_WithTwoFilters_ShouldCallAllItems() { var filter1Called = false; var filter2Called = false; Action <RequestContext> filter1 = context => { filter1Called = true; }; Action <RequestContext> filter2 = context => { filter2Called = true; }; _filters += filter1; _filters += filter2; _filters.Invoke(null); Assert.That(filter1Called, Is.True); Assert.That(filter2Called, Is.True); }
public void SetUp() { _filters = new BeforeFilters(); }
public void SetUp() { _filters = new BeforeFilters(); }