public void TestCastComplexityTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67001" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Cost Complexity distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "8,881", "8,824", "+57", "+0.65 %", "86.3 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "1,167", "1,140", "+27", "+2.37 %", "11.3 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "172", "170", "+2", "+1.18 %", "1.67 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "71", "68", "+3", "+4.41 %", "0.69 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
Example #2
0
        public void TestOneSnapshot()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, null, null, null, null);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", null);

            var component = new CastComplexity();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "CAST Complexity", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "8,881", "n/a", "n/a", "n/a", "86.3 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "1,167", "n/a", "n/a", "n/a", "11.3 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "172", "n/a", "n/a", "n/a", "1.67 %"
            });
            expectedData.AddRange(new List <string> {
                "Very High Complexity", "71", "n/a", "n/a", "n/a", "0.69 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
        }
        public void TestFourGLComplexityTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "65601" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "4GL Complexity Distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "0", "0", "0", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "0", "0", "0", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "0", "0", "0", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "0", "0", "0", "n/a", "n/a"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestCastComplexityNoPar()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, null, null, null, null);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", null);

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>();
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Cost Complexity distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "8,881", "n/a", "n/a", "n/a", "86.3 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "1,167", "n/a", "n/a", "n/a", "11.3 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "172", "n/a", "n/a", "n/a", "1.67 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "71", "n/a", "n/a", "n/a", "0.69 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestSizeDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "65105" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Size Distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "8,619", "8,558", "+61", "+0.71 %", "83.8 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "1,315", "1,298", "+17", "+1.31 %", "12.8 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "321", "310", "+11", "+3.55 %", "3.12 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "36", "36", "0", "0 %", "0.35 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestCyclomaticComplexityTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "65501" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Cyclomatic Complexity Distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "8,305", "8,235", "+70", "+0.85 %", "88.6 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "838", "824", "+14", "+1.70 %", "8.94 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "161", "159", "+2", "+1.26 %", "1.72 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "71", "68", "+3", "+4.41 %", "0.76 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestReusebyCallDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "66010" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Reuse by Call Distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "9,413", "9,345", "+68", "+0.73 %", "91.5 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "666", "653", "+13", "+1.99 %", "6.47 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "170", "163", "+7", "+4.29 %", "1.65 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "42", "41", "+1", "+2.44 %", "0.41 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastComplexityWithViolation();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "CAST Complexity", "Artifacts", "With Violations"
            });
            expectedData.AddRange(new List <string> {
                "Extreme", "71", "29"
            });
            expectedData.AddRange(new List <string> {
                "High", "172", "74"
            });
            expectedData.AddRange(new List <string> {
                "Average", "1,167", "270"
            });
            expectedData.AddRange(new List <string> {
                "Low", "8,881", "221"
            });
            TestUtility.AssertTableContent(table, expectedData, 3, 4);
            Assert.IsTrue(table.HasColumnHeaders);
            Assert.IsFalse(table.HasRowHeaders);
        }
Example #9
0
        public void TestViolationsToCriticalDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastHighDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67020" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Distribution of violations to critical diagnostic-based metrics per cost complexity", "Current", "Previous", "Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "High and Very High Complexity", "166", "161", "+5", "23.7 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 5, 2);
            Assert.IsTrue(table.HasColumnHeaders);
        }
Example #10
0
        public void TestCastComplexityOneSnapshot()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, null, null, null, null);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", null);

            var component = new CastHighDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67001" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Cost Complexity distribution", "Current", "Previous", "Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "High and Very High Complexity", "243", "n/a", "n/a", "2.36 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 5, 2);
            TestUtility.AssertTableContent(table, expectedData, 5, 2);
            Assert.IsTrue(table.HasColumnHeaders);
        }
Example #11
0
        public void TestClassFanInComplexityTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastHighDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "66021" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Class Fan-In Distribution", "Current", "Previous", "Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "High and Very High Complexity", "41", "40", "+1", "7 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 5, 2);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestViolationsToCriticalDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67020" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Distribution of violations to critical diagnostic-based metrics per cost complexity", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "227", "226", "+1", "+0.44 %", "32.4 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "308", "299", "+9", "+3.01 %", "43.9 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "107", "106", "+1", "+0.94 %", "15.3 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "59", "55", "+4", "+7.27 %", "8.42 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestDefectsToCriticalDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67030" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Distribution of defects to critical diagnostic-based metrics per cost complexity", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "221", "221", "0", "0 %", "37.2 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "270", "262", "+8", "+3.05 %", "45.5 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "74", "73", "+1", "+1.37 %", "12.5 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "29", "26", "+3", "+11.5 %", "4.88 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
        public void TestClassFanInComplexityTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "66021" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Class Fan-In Distribution", "Current", "Previous", "Evol.", "% Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "Low Complexity", "527", "525", "+2", "+0.38 %", "89.9 %"
            });
            expectedData.AddRange(new List <string> {
                "Average Complexity", "18", "17", "+1", "+5.88 %", "3.07 %"
            });
            expectedData.AddRange(new List <string> {
                "High Complexity", "19", "19", "0", "0 %", "3.24 %"
            });
            expectedData.AddRange(new List <string> {
                "Extreme Complexity", "22", "21", "+1", "+4.76 %", "3.75 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 6, 5);
            Assert.IsTrue(table.HasColumnHeaders);
        }
Example #15
0
        public void TestContentInChinese()
        {
            TestUtility.SetCulture("zh-CN");
            CastDate currentDate = new CastDate {
                Time = 1496959200000
            };
            CastDate previousDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("CoCRestAPI",
                                                                             null, @".\Data\critViolStats.json", "AED/applications/3/snapshots/5", "Snap5_CAIP-8.3ra2_RG-1.6a", "8.3.ra2", currentDate,
                                                                             null, @".\Data\critViolStatsPrevious.json", "AED/applications/3/snapshots/4", "Snap5_CAIP-8.3ra_RG-1.5.0", "8.3.ra", previousDate);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new ViolationStatisticsEvolution();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "名称", "当前", "上一个", "%演变"
            });
            expectedData.AddRange(new List <string> {
                "关键违规数", "75", "97", "-22.7%"
            });
            expectedData.AddRange(new List <string> {
                "  每文件", "0.22", "0.26", "-15.4%"
            });
            expectedData.AddRange(new List <string> {
                "  每千行代码", "3.53", "4.34", "-18.7%"
            });
            expectedData.AddRange(new List <string> {
                "复杂对象", "243", "238", "+2.10%"
            });
            expectedData.AddRange(new List <string> {
                "  含违规", "103", "99", "+4.04%"
            });
            TestUtility.AssertTableContent(table, expectedData, 4, 6);
            Assert.IsFalse(table.HasColumnHeaders);
            Assert.IsTrue(table.HasRowHeaders);
        }
Example #16
0
        public void TestNegativePerFile()
        {
            CastDate currentDate = new CastDate {
                Time = 1496959200000
            };
            CastDate previousDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("CoCRestAPI",
                                                                             null, @".\Data\cocraCritViolStats.json", "AED/applications/3/snapshots/5", "Snap5_CAIP-8.3ra2_RG-1.6a", "8.3.ra2", currentDate,
                                                                             null, @".\Data\cocraCritViolStatsPrevious.json", "AED/applications/3/snapshots/4", "Snap5_CAIP-8.3ra_RG-1.5.0", "8.3.ra", previousDate);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new ViolationStatisticsEvolution();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Name", "Current", "Previous", "% Evolution"
            });
            expectedData.AddRange(new List <string> {
                "Critical Violations", "1,411", "680", "+108 %"
            });
            expectedData.AddRange(new List <string> {
                "  per File", "n/a", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "  per kLoC", "0.91", "10.89", "-91.6 %"
            });
            expectedData.AddRange(new List <string> {
                "Complex Objects", "243", "238", "+2.10 %"
            });
            expectedData.AddRange(new List <string> {
                "  With Violations", "103", "99", "+4.04 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 4, 6);
            Assert.IsFalse(table.HasColumnHeaders);
            Assert.IsTrue(table.HasRowHeaders);
        }
        public void TestTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastHighComplexity();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "CAST Complexity", "Current", "Previous", "Evol.", "% Total"
            });
            expectedData.AddRange(new List <string> {
                "High and Very High Complexity", "243", "238", "+5", "2.36 %"
            });
            TestUtility.AssertTableContent(table, expectedData, 5, 2);
        }
Example #18
0
        public void TestDefectsToCriticalDistributionTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67030" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                " ", "V-1.5.0_Sprint 2_2", "V-1.4.1"
            });
            expectedData.AddRange(new List <string> {
                " ", "0", "0"
            });
            expectedData.AddRange(new List <string> {
                "Low", "221", "221"
            });
            expectedData.AddRange(new List <string> {
                "Average", "270", "262"
            });
            expectedData.AddRange(new List <string> {
                "High", "74", "73"
            });
            expectedData.AddRange(new List <string> {
                "Very High", "29", "26"
            });
            expectedData.AddRange(new List <string> {
                " ", "0", "0"
            });
            TestUtility.AssertTableContent(table, expectedData, 3, 7);
        }
Example #19
0
        public void TestCastComplexityOneSnapshot()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, null, null, null, null);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", null);

            var component = new CastDistribution();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "PAR", "67001" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                " ", "V-1.5.0_Sprint 2_2"
            });
            expectedData.AddRange(new List <string> {
                " ", "0"
            });
            expectedData.AddRange(new List <string> {
                "Low", "8881"
            });
            expectedData.AddRange(new List <string> {
                "Average", "1167"
            });
            expectedData.AddRange(new List <string> {
                "High", "172"
            });
            expectedData.AddRange(new List <string> {
                "Very High", "71"
            });
            expectedData.AddRange(new List <string> {
                " ", "0"
            });
            TestUtility.AssertTableContent(table, expectedData, 2, 7);
        }
Example #20
0
        public void TestOneSnapshot()
        {
            CastDate currentDate = new CastDate {
                Time = 1496959200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("CoCRestAPI",
                                                                             null, @".\Data\critViolStats.json", "AED/applications/3/snapshots/5", "Snap5_CAIP-8.3ra2_RG-1.6a", "8.3.ra2", currentDate,
                                                                             null, null, null, null, null, null);

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", null);

            var component = new ViolationStatisticsEvolution();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Name", "Current", "Previous", "% Evolution"
            });
            expectedData.AddRange(new List <string> {
                "Critical Violations", "75", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "  per File", "0.22", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "  per kLoC", "3.53", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "Complex Objects", "243", "n/a", "n/a"
            });
            expectedData.AddRange(new List <string> {
                "  With Violations", "103", "n/a", "n/a"
            });
            TestUtility.AssertTableContent(table, expectedData, 4, 6);
            Assert.IsFalse(table.HasColumnHeaders);
            Assert.IsTrue(table.HasRowHeaders);
        }
Example #21
0
        public void TestTwoSnapshots()
        {
            ReportData reportData = TestUtility.PrepaReportData("ReportGenerator",
                                                                null, @".\Data\Sample1Current.json", "AED/applications/3/snapshots/6", "PreVersion 1.5.0 sprint 2 shot 2", "V-1.5.0_Sprint 2_2",
                                                                null, @".\Data\Sample1Previous.json", "AED/applications/3/snapshots/3", "PreVersion 1.4.1 before release", "V-1.4.1");

            reportData = TestUtility.AddApplicationComplexity(reportData, @".\Data\ComplexitySnapCurrent.json", @".\Data\ComplexitySnapPrevious.json");

            var component = new CastComplexity();
            var table     = component.Content(reportData, null);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                " ", "V-1.5.0_Sprint 2_2", "V-1.4.1"
            });
            expectedData.AddRange(new List <string> {
                " ", "0", "0"
            });
            expectedData.AddRange(new List <string> {
                "Low", "8881", "8824"
            });
            expectedData.AddRange(new List <string> {
                "Average", "1167", "1140"
            });
            expectedData.AddRange(new List <string> {
                "High", "172", "170"
            });
            expectedData.AddRange(new List <string> {
                "Very High", "71", "68"
            });
            expectedData.AddRange(new List <string> {
                " ", "0", "0"
            });
            TestUtility.AssertTableContent(table, expectedData, 3, 7);
        }