Beispiel #1
0
        public void TestLowComplexityDeleted()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            CastDate previousDate = new CastDate {
                Time = 1484866800000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.json", "AED/applications/3/snapshots/6", "1.5.0", "V-1.5.0", currentDate,
                                                                             null, @".\Data\PreviousBCresults.json", "AED/applications/3/snapshots/5", "1.4.0", "V-1.4.0", previousDate);

            reportData.RuleExplorer = new RuleBLLStub();

            var component = new CastReporting.Reporting.Block.Table.DeltaComponentsListByStatus();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "COMPLEXITY", "low" },
                { "STATUS", "deleted" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Object Name", "Complexity", "SQL Complexity", "Granularity", "Lack of comments", "Coupling", "Number of object updates", "Object full name"
            });
            expectedData.AddRange(new List <string> {
                "get", "low risk", "low risk", "low risk", "very high risk", "moderate risk", "0", "CastReporting.BLL.Computing.ViolationSummaryModuleDTO.this.get"
            });
            TestUtility.AssertTableContent(table, expectedData, 8, 2);
        }
Beispiel #2
0
        public void TestBadTechnology()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            CastDate previousDate = new CastDate {
                Time = 1484866800000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.json", "AED/applications/3/snapshots/6", "1.5.0", "V-1.5.0", currentDate,
                                                                             null, @".\Data\PreviousBCresults.json", "AED/applications/3/snapshots/5", "1.4.0", "V-1.4.0", previousDate);

            reportData.RuleExplorer             = new RuleBLLStub();
            reportData.Application.Technologies = new[] { "JEE" };

            var component = new CastReporting.Reporting.Block.Table.DeltaComponentsListByStatus();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "TECHNOLOGY", ".NET" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Object Name", "Complexity", "SQL Complexity", "Granularity", "Lack of comments", "Coupling", "Number of object updates", "Object full name"
            });
            expectedData.AddRange(new List <string> {
                "Technology not found in this application.", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty
            });
            TestUtility.AssertTableContent(table, expectedData, 8, 2);
        }
Beispiel #3
0
        public void TestNoConfigNoPrevious()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.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);

            reportData.RuleExplorer = new RuleBLLStub();

            var component = new CastReporting.Reporting.Block.Table.DeltaComponentsListByStatus();
            Dictionary <string, string> config = new Dictionary <string, string>();
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Object Name", "Complexity", "SQL Complexity", "Granularity", "Lack of comments", "Coupling", "Number of object updates", "Object full name"
            });
            expectedData.AddRange(new List <string> {
                "Previous snapshot was not found.", string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty
            });

            TestUtility.AssertTableContent(table, expectedData, 8, 2);
        }
Beispiel #4
0
        public void TestTechnology()
        {
            CastDate currentDate = new CastDate {
                Time = 1484953200000
            };
            CastDate previousDate = new CastDate {
                Time = 1484866800000
            };
            ReportData reportData = TestUtility.PrepareApplicationReportData("ReportGenerator",
                                                                             null, @".\Data\CurrentBCresults.json", "AED/applications/3/snapshots/6", "1.5.0", "V-1.5.0", currentDate,
                                                                             null, @".\Data\PreviousBCresults.json", "AED/applications/3/snapshots/5", "1.4.0", "V-1.4.0", previousDate);

            reportData.RuleExplorer             = new RuleBLLStub();
            reportData.Application.Technologies = new[] { "JEE" };

            var component = new CastReporting.Reporting.Block.Table.DeltaComponentsListByStatus();
            Dictionary <string, string> config = new Dictionary <string, string>
            {
                { "TECHNOLOGY", "JEE" }
            };
            var table = component.Content(reportData, config);

            var expectedData = new List <string>();

            expectedData.AddRange(new List <string> {
                "Object Name", "Complexity", "SQL Complexity", "Granularity", "Lack of comments", "Coupling", "Number of object updates", "Object full name"
            });
            expectedData.AddRange(new List <string> {
                "get", "low risk", "low risk", "low risk", "very high risk", "moderate risk", "0", "CastReporting.BLL.Computing.ViolationSummaryModuleDTO.this.get"
            });
            expectedData.AddRange(new List <string> {
                "SetActionsPlan", "moderate risk", "low risk", "moderate risk", "moderate risk", "low risk", "0", "CastReporting.BLL.PortfolioSnapshotsBLL.SetActionsPlan"
            });
            expectedData.AddRange(new List <string> {
                "GetRulesDetails", "high risk", "low risk", "low risk", "low risk", "low risk", "0", "CastReporting.BLL.RuleBLL.GetRulesDetails"
            });
            expectedData.AddRange(new List <string> {
                "GetRulesDetails", "very high risk", "low risk", "low risk", "low risk", "low risk", "0", "CastReporting.Domain.Interfaces.IRuleExplorer.GetRulesDetails"
            });
            TestUtility.AssertTableContent(table, expectedData, 8, 5);
        }