public void TestFindMethodsUsedBy_OneLocalMethodAsLambda() { var method = GetMethodReference(typeof(SimpleClassUsingLinq).FullName, "ProjectionOverLocalMethod"); var usedMethods = DependencyStructureExplorer.FindMethodsUsedBy(method); Assert.That(usedMethods.Any(m => m.Name == "IncrInt")); }
public void TestFindMethodsUsedBy_OneReferencedLocalMethod() { var method = GetMethodReference(typeof(SimpleClass).FullName, "PublicMethod"); var usedMethods = DependencyStructureExplorer.FindMethodsUsedBy(method); Assert.AreEqual(1, usedMethods.Count()); Assert.AreEqual("PrivateMethod", usedMethods.First().Name); }
public void TestFindMethodsUsedBy_TwoReferencedLocalMethods() { var method = GetMethodReference(typeof(SimpleClass).FullName, "PublicMethodUsingTwoOtherMethods"); var usedMethods = DependencyStructureExplorer.FindMethodsUsedBy(method); Assert.AreEqual(2, usedMethods.Count()); Assert.That(usedMethods.Any(m => m.Name == "PrivateMethod")); Assert.That(usedMethods.Any(m => m.Name == "ProtectedMethod")); }