"景先生毕设|www.jxszl.com

C# AfterPipeline类代码示例

2023-12-29 17:03编辑: www.jxszl.com景先生毕设
本文整理汇总了C#中AfterPipeline类的典型用法代码示例。如果您正苦于以下问题:C#AfterPipeline类的具体用法?C#AfterPipeline怎么用?C#AfterPipeline使用的例子?这里精选的类代码示例或许可以为您提供帮助。 示例1:HandleRequest_should_allow_module_after_hook_to_add_items_to_context publicvoidHandleRequest_should_allow_module_after_hook_to_add_items_to_context() { //Given varroute=newFakeRoute(); varbefore=newBeforePipeline(); before+=ctx=>null; varafter=newAfterPipeline(); after+=ctx=>ctx.Items.Add("RoutePostReq",newobject()); varresolvedRoute=newResolveResult( route, DynamicDictionary.Empty, before, after, null); A.CallTo(()=>this.routeResolver.Resolve(A.Ignored)).Returns(resolvedRoute); varcontext= newNancyContext{Request=newRequest("GET","/","http")}; //When this.requestDispatcher.Dispatch(context,newCancellationToken()); //Then context.Items.ContainsKey("RoutePostReq").ShouldBeTrue(); }
原文链接:http://www.jxszl.com/biancheng/C/556491.html