CCMTests.IntegrationTests.FunctionIsInCollection C# (CSharp) Метод

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

private static FunctionIsInCollection ( string function, int>.Dictionary collection ) : bool
function string
collection int>.Dictionary
Результат bool
        private static bool FunctionIsInCollection(string function, Dictionary<string, int> collection)
        {
            Dictionary<string, int>.Enumerator e = collection.GetEnumerator();

              while (e.MoveNext())
              {
            if (e.Current.Key.Contains(function))
              return true;
              }

              return false;
        }

Usage Example

Пример #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);
        }
All Usage Examples Of CCMTests.IntegrationTests::FunctionIsInCollection