Ejemplo n.º 1
0
        public void TestModuleContent()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCTC.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2", currentDate,
                                                                             null, null, null, null, null, null);

            WSConnection connection = new WSConnection()
            {
                Url      = "http://tests/CAST-RESTAPI/rest/",
                Login    = "******",
                Password = "******",
                IsActive = true,
                Name     = "Default"
            };

            reportData.SnapshotExplorer = new SnapshotBLLStub(connection, reportData.CurrentSnapshot);

            var component = new CastReporting.Reporting.Block.Table.TopRiskiestComponents();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "SRC", "SEC" },
                { "MOD", "4" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Artifact Name", "PRI"
            });
            expectedData.AddRange(new List <string> {
                "measure.dss_history", "140,504"
            });
            expectedData.AddRange(new List <string> {
                "com.castsoftware.aad.common.AadCommandLine.dumpStack", "122,280"
            });
            expectedData.AddRange(new List <string> {
                "measure.dss_snapshots", "56,224"
            });
            expectedData.AddRange(new List <string> {
                "com.castsoftware.aad.common.AadCommandLine.logInBase", "54,120"
            });
            expectedData.AddRange(new List <string> {
                "measure.dss_objects", "42,504"
            });
            TestUtility.AssertTableContent(table, expectedData, 2, 7);
        }
Ejemplo n.º 2
0
        public void TestLimitCount()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCTC.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2", currentDate,
                                                                             null, null, null, null, null, null);

            WSConnection connection = new WSConnection()
            {
                Url      = "http://tests/CAST-RESTAPI/rest/",
                Login    = "******",
                Password = "******",
                IsActive = true,
                Name     = "Default"
            };

            reportData.SnapshotExplorer = new SnapshotBLLStub(connection, reportData.CurrentSnapshot);

            var component = new CastReporting.Reporting.Block.Table.TopRiskiestComponents();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "SRC", "SEC" },
                { "COUNT", "2" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Artifact Name", "PRI"
            });
            expectedData.AddRange(new List <string> {
                "central.dss_metric_results", "229,656"
            });
            expectedData.AddRange(new List <string> {
                "central.dss_history", "180,488"
            });
            TestUtility.AssertTableContent(table, expectedData, 2, 4);
        }