public override void TestInitialize() { base.TestInitialize(); ConfigOptions = new ConfigOptions() { FetchConfig = TypeCollectionTester.GetDefaultFetchConfig(), QueryParams = new NameValueCollection() }; WorkspaceBuilder.DefaultProject .AddFakeMvc(); // Test class to use as return/param AddClass("TestClass") .AddScriptObjectAttribute() .AddProperty("DontCare", "int") .Commit(); // Test generic class to use as return/param AddClass("TestGenericClass") .AddScriptObjectAttribute() .AddGenericParameter("T") .AddProperty("GenericProp", "T") .Commit(); ControllerBuilder = AddClass(ControllerFullName) .WithControllerBaseClass() // Fake Json method .AddMethod("Json", MvcConstants.JsonResult_AspNetCore) .AddParameter("data", "object") .AddLineOfCode("return null;", 0) .Commit(); }
private ControllerContext CreateContext(TypeCollectionTester tester) { return(tester.GetDefaultControllerContext(ControllerFullName, ConfigOptions)); }