예제 #1
0
        private IWebApiConnector CreateNewPage(int templateTabId, out int tabId)
        {
            var pagesExecuter = new PagesExecuter {
                Connector = WebApiTestHelper.LoginHost()
            };

            var pageSettingsBuilder = new PageSettingsBuilder();

            pageSettingsBuilder.WithPermission(new TabPermissionsBuilder().Build());

            if (templateTabId > 0)
            {
                pageSettingsBuilder.WithTemplateTabId(templateTabId);

                var modules = DatabaseHelper.ExecuteQuery <CopyModuleItem>($"SELECT ModuleId, ModuleTitle FROM {{objectQualifier}}TabModules WHERE TabId = {templateTabId}");
                pageSettingsBuilder.WithCopyModules(modules.ToList());
            }

            var pageDetail = pagesExecuter.SavePageDetails(pageSettingsBuilder.Build());

            Assert.NotNull(pageDetail.Page, "The system must create the page and return its details in the response");

            tabId = (int)pageDetail.Page.id;

            return(pagesExecuter.Connector);
        }
예제 #2
0
        private static int CreateNewPage(IWebApiConnector connector)
        {
            var pagesExecuter = new PagesExecuter {
                Connector = connector
            };
            var pageSettingsBuilder = new PageSettingsBuilder();

            pageSettingsBuilder.WithPermission(new TabPermissionsBuilder().Build());
            var pageDetail = pagesExecuter.SavePageDetails(pageSettingsBuilder.Build());

            Assert.NotNull(pageDetail.Page, "The system must create the page and return its details in the response");
            return((int)pageDetail.Page.id);
        }
예제 #3
0
        private IWebApiConnector CreateNewSecurePage(out int tabId)
        {
            var pagesExecuter = new PagesExecuter {
                Connector = WebApiTestHelper.LoginHost()
            };

            var pageSettingsBuilder = new PageSettingsBuilder();

            pageSettingsBuilder.WithPermission(new TabPermissionsBuilder().Build());
            pageSettingsBuilder.WithSecure(true);

            var pageDetail = pagesExecuter.SavePageDetails(pageSettingsBuilder.Build());

            Assert.NotNull(pageDetail.Page, "The system must create the page and return its details in the response");

            tabId = (int)pageDetail.Page.id;

            return(pagesExecuter.Connector);
        }