Example #1
0
        public static string GenerateTestPage(FactoryInformation information)
        {
            List <string> Properties = new List <string>();

            information.PageFields.RemoveAll(field => field.IsListColumnOnly);
            TestModel test = new TestModel(information.PageFields, information.Blocks, Properties);

            test.FormatToListAssignmentFormat();
            TestsTemplate testPage = new TestsTemplate();

            foreach (var item in information.PropertieModels)
            {
                Properties.Add(ModelHelpers.ConvertToPascalCasePattern(item.ColumnName));
            }

            testPage.Session = new Dictionary <string, object>();

            testPage.Session.Add("ColumnsNames", test.ToString());
            testPage.Session.Add("RequiredFields", test.RequiredFields);
            testPage.Session.Add("ClassName", information.Page.ClassName);
            testPage.Session.Add("AllBlocksList", test.AllBlocksList);
            testPage.Session.Add("ReadWriteUsers", information.Permissions.GetReadWriteUsersString());
            testPage.Session.Add("ReadOnlyUsers", information.Permissions.GetReadOnlyUsersString());
            testPage.Session.Add("NoReadUsers", information.Permissions.GetNoReadUsersString());
            testPage.Session.Add("UsersThatHasAccessToThePage", information.Permissions.GetUsersThatHasAccessToThePagesString());
            testPage.Session.Add("EditMethod", test.GenerateEdit());
            testPage.Session.Add("AssertMethod", test.GenerateAssert());

            testPage.Initialize();
            return(testPage.TransformText());
        }
Example #2
0
        public static string Generate(FactoryInformation information)
        {
            APIModelTemplate modelTemplate = new APIModelTemplate();

            modelTemplate.Session = new Dictionary <string, object>();

            modelTemplate.Session.Add("ClassName", information.Page.ClassName);
            modelTemplate.Session.Add("Constructor", information.APIClass.GetConstructorModel());
            modelTemplate.Session.Add("Properties", information.PropertieModels);

            modelTemplate.Initialize();
            return(modelTemplate.TransformText());
        }
        public static string Generate(FactoryInformation information)
        {
            APIFactoryTemplate modelTemplate     = new APIFactoryTemplate();
            APIFactoryModel    aPIFactoryFactory = new APIFactoryModel(information.PropertieModels, information.Page.ClassName);

            modelTemplate.Session = new Dictionary <string, object>();

            modelTemplate.Session.Add("Properties", aPIFactoryFactory.GenerateInit());
            modelTemplate.Session.Add("ClassName", information.Page.ClassName);
            modelTemplate.Session.Add("ObjectName", information.Page.ClassName.ToLower());
            modelTemplate.Initialize();

            return(modelTemplate.TransformText());
        }
Example #4
0
        public static string Generate(FactoryInformation information)
        {
            TestPagePermissionsTemplate testPage = new TestPagePermissionsTemplate();

            testPage.Session = new Dictionary <string, object>();

            testPage.Session.Add("ClassName", information.Page.ClassName);
            testPage.Session.Add("ReadWriteUsers", information.Permissions.GetReadWriteUsersString());
            testPage.Session.Add("ReadOnlyUsers", information.Permissions.GetReadOnlyUsersString());
            testPage.Session.Add("NoReadUsers", information.Permissions.GetNoReadUsersString());
            testPage.Session.Add("UsersThatHasAccessToThePage", information.Permissions.GetUsersThatHasAccessToThePagesString());

            testPage.Initialize();
            return(testPage.TransformText());
        }