Beispiel #1
0
        public void GrcScriptCutdown(int numberOfUsers, int repeats, int paceMs = 0)
        {
            if (reportId == 0)
            {
                GrcScriptCutdown_Warmup( );
            }

            // Run Report
            Action runReport = () =>
            {
                ReportControllerTestHelper.GetReportFull(reportId);
                EntityControllerTestHelper.Query_RefreshReport(reportId);
                ActionControllerTestHelper.GetReportQuickMenu(reportId);
            };

            // Load Edit Form
            Action runEditForm = () =>
            {
                FormControllerTestHelper.GetFormLayout(formId);
                EntityControllerTestHelper.Query_PendingTasks(typeId);
                ReportControllerTestHelper.GetRelationshipTabReportFull(tabReportId, tabRelId, false);
                ReportControllerTestHelper.GetEditFormListboxContents(listboxReportId);
                ActionControllerTestHelper.GetRelationshipTabQuickMenu(reportId, tabEntityTypeId);
            };

            // Show Owner picker
            Action runPicker = () =>
            {
                ReportControllerTestHelper.GetReportFull(pickerReportId);
                EntityControllerTestHelper.Query_Name(pickerTypeId);
                ActionControllerTestHelper.GetPickerQuickMenu(pickerReportId, pickerTypeId);
            };

            // Save
            string        createInstanceJson = GetNewBusinessUnitJson( );
            Action <long> createEntity       = (userId) =>
            {
                var json = createInstanceJson.Replace("99999999", userId.ToString( ));
                json = json.Replace("%NAME%", "BU-" + Guid.NewGuid( ).ToString( ));
                EntityControllerTestHelper.RunSave(json);
            };

            var context = RequestContext.GetContext( );

            List <UserAccount> accounts = CreateGRCTestUsers(numberOfUsers, "BCP Manager,Compliance Manager,Risk Manager");

            TestHelpers.TestConcurrent(numberOfUsers, (threadNumber) =>
            {
                var account = accounts [threadNumber];
                using (new CustomContext(context))
                    using (new SetUser(account))
                    {
                        runReport( );
                        runEditForm( );
                        runPicker( );
                        createEntity(account.Id);
                    }
            }, true, repeats, paceMs);
        }
Beispiel #2
0
        public void RunReportWithMetadata_Concurrent( )
        {
            if (_reportId == 0)
            {
                _reportId = EDC.ReadiNow.Expressions.CodeNameResolver.GetInstance(_reportName, "Report").Id;
            }

            TestHelpers.TestConcurrent(10, () =>
            {
                ReportResult body = ReportControllerTestHelper.GetReportRequest(string.Format(@"data/v1/report/{0}?metadata=full&page=0,200", _reportId), HttpStatusCode.OK);
            }, false, 10);
        }
Beispiel #3
0
        public void RunReportWithMetadata()
        {
            if (_reportId == 0)
            {
                _reportId = EDC.ReadiNow.Expressions.CodeNameResolver.GetInstance(_reportName, "Report").Id;
            }

            using (Profiler.Measure("Run report test"))
            {
                ReportResult body = ReportControllerTestHelper.GetReportRequest(string.Format(@"data/v1/report/{0}?metadata=full&page=0,200", _reportId), HttpStatusCode.OK);

                Assert.IsTrue(body.GridData.Count > 0, "No records returned");
                Assert.IsNotNull(body.Metadata, "We don't have report metadata");
            }
        }