GetComplexityFromCollection() приватный статический Метод

private static GetComplexityFromCollection ( string function, int>.Dictionary collection ) : int
function string
collection int>.Dictionary
Результат int
Пример #1
0
        public void TrendLogTest()
        {
            AnalyzerCollector collector = IntegrationTests.Analyze("log.cs");

            Assert.AreEqual(1, collector.Collection.Count);
            Assert.AreEqual(true, IntegrationTests.FunctionIsInCollection("Log::Write", collector.Collection));
            Assert.AreEqual(1, IntegrationTests.GetComplexityFromCollection("Log::Write", collector.Collection));

            Assert.AreEqual(15, collector.Metrics["Log::Write(string text)"].StartLineNumber);
            Assert.AreEqual(17, collector.Metrics["Log::Write(string text)"].EndLineNumber);
        }
Пример #2
0
        public void ValianTest()
        {
            AnalyzerCollector collector = IntegrationTests.Analyze("valian.c");

            Assert.AreEqual(3, collector.Collection.Count);
            Assert.IsTrue(IntegrationTests.FunctionIsInCollection("SmpEditFrameProc", collector.Collection));
            Assert.IsTrue(IntegrationTests.FunctionIsInCollection("InstrumentWndProc", collector.Collection));
            Assert.IsTrue(IntegrationTests.FunctionIsInCollection("InstrumentWndProc2", collector.Collection));

            Assert.AreEqual(3, IntegrationTests.GetComplexityFromCollection("InstrumentWndProc", collector.Collection));
            Assert.AreEqual(5, IntegrationTests.GetComplexityFromCollection("InstrumentWndProc2", collector.Collection));
            Assert.AreEqual(22, IntegrationTests.GetComplexityFromCollection("SmpEditFrameProc", collector.Collection));
        }
Пример #3
0
        public void ReportedCppErrors()
        {
            AnalyzerCollector collector = IntegrationTests.Analyze("ReportedCppErrors.cpp");

            Assert.AreEqual(4, collector.Collection.Count);
            Assert.AreEqual(true, IntegrationTests.FunctionIsInCollection("DllMain", collector.Collection));
            Assert.AreEqual(true, IntegrationTests.FunctionIsInCollection("test::testing", collector.Collection));
            Assert.AreEqual(true, IntegrationTests.FunctionIsInCollection("GetXMLStuff", collector.Collection));
            Assert.AreEqual(true, IntegrationTests.FunctionIsInCollection("AssertWinFile", collector.Collection));

            Assert.AreEqual(6, IntegrationTests.GetComplexityFromCollection("DllMain", collector.Collection));
            Assert.AreEqual(4, IntegrationTests.GetComplexityFromCollection("test::testing", collector.Collection));
            Assert.AreEqual(1, IntegrationTests.GetComplexityFromCollection("GetXMLStuff", collector.Collection));
            Assert.AreEqual(2, IntegrationTests.GetComplexityFromCollection("AssertWinFile", collector.Collection));
        }