Esempio n. 1
0
 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", new Dictionary<string, string>(), "Hello world"))
         );
     var callResult = AppUtils.Call(app);
     Assert.That(callResult.Status, Is.EqualTo("200 OKAppendCustom"));
 }
Esempio n. 2
0
 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", new Dictionary<string, string>(), "Hello world"))
         );
     var callResult = AppUtils.Call(app);
     Assert.That(callResult.Status, Is.EqualTo("200 OKWithMiddleware"));
 }