File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -342,7 +342,7 @@ private void PrepareController()
342342 {
343343 this . controller . Request = this . HttpRequestMessage ;
344344 this . controller . RequestContext = this . HttpRequestMessage . GetRequestContext ( ) ;
345- this . controller . Configuration = new HttpConfiguration ( ) ;
345+ this . controller . Configuration = MyWebApi . Configuration ?? new HttpConfiguration ( ) ;
346346 this . controller . User = MockedIPrinciple . CreateUnauthenticated ( ) ;
347347 }
348348
Original file line number Diff line number Diff line change @@ -27,6 +27,11 @@ namespace MyWebApi
2727 /// </summary>
2828 public static class MyWebApi
2929 {
30+ public static void IsUsing ( HttpConfiguration httpConfiguration )
31+ {
32+ Configuration = httpConfiguration ;
33+ }
34+
3035 /// <summary>
3136 /// Selects controller on which the test will be executed. Controller is instantiated with default constructor.
3237 /// </summary>
@@ -63,5 +68,7 @@ public static IControllerBuilder<TController> Controller<TController>(Func<TCont
6368 var controllerInstance = construction ( ) ;
6469 return new ControllerBuilder < TController > ( controllerInstance ) ;
6570 }
71+
72+ internal static HttpConfiguration Configuration { get ; private set ; }
6673 }
6774}
You can’t perform that action at this time.
0 commit comments