Пример #1
0
        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();
        }
Пример #2
0
 private ControllerContext CreateContext(TypeCollectionTester tester)
 {
     return(tester.GetDefaultControllerContext(ControllerFullName, ConfigOptions));
 }