public void Class_with_IMiddleware_can_have_parameters() { var withMiddleware2 = new WithMiddleware(); var app = Build(b => b .Use(withMiddleware2.Middleware, "AppendCustom") .Run(AppUtils.Simple("200 OK", Headers.New(), "Hello world")) ); var callResult = AppUtils.Call(app); Assert.That(callResult.Status, Is.EqualTo("200 OKAppendCustom")); }
public void Class_with_IMiddleware_can_be_used_by_AppBuilder() { var withMiddleware = new WithMiddleware(); var app = Build(b => b .Use(withMiddleware.Middleware) .Run(AppUtils.Simple("200 OK", Headers.New(), "Hello world")) ); var callResult = AppUtils.Call(app); Assert.That(callResult.Status, Is.EqualTo("200 OKWithMiddleware")); }