/// <summary>
 /// Initializes a new instance of the <see cref="ControllerBuilder{TController}"/> class.
 /// </summary>
 /// <param name="testContext"><see cref="ControllerTestContext"/> containing data about the currently executed assertion chain.</param>
 public ControllerBuilder(ControllerTestContext testContext)
     : base(testContext)
 {
     this.EnabledModelStateValidation = TestApplication
                                        .Configuration()
                                        .Controllers()
                                        .ModelStateValidation();
 }
Exemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MyRouting"/> class.
 /// </summary>
 public MyRouting()
     : base(new RouteTestContext
 {
     Router   = TestApplication.Router,
     Services = TestApplication.RoutingServices
 })
 {
     if (TestApplication.Configuration().General().NoStartup())
     {
         throw new InvalidOperationException("Testing routes without a Startup class is not supported. Set the 'General.NoStartup' option in the test configuration ('testconfig.json' file by default) to 'true' and provide a Startup class.");
     }
 }