public void GetCSharpClassesReferencingAGivenClassReturnsEmptyArrayForEmptyList() { var result = ApexTestFinder.GetApexClassesReferencingAGivenClass((MemberDeclarationSyntax[])null, "Something"); Assert.NotNull(result); Assert.IsEmpty(result); result = ApexTestFinder.GetApexClassesReferencingAGivenClass(new MemberDeclarationSyntax[0], "Something"); Assert.NotNull(result); Assert.IsEmpty(result); }
public void GetApexClassesReferencingAGivenClassReturnsEmptyArrayForEmptyList() { var result = ApexTestFinder.GetApexClassesReferencingAGivenClass((string[])null, "Something"); Assert.NotNull(result); Assert.IsEmpty(result); result = ApexTestFinder.GetApexClassesReferencingAGivenClass(new string[0], "Something"); Assert.NotNull(result); Assert.IsEmpty(result); }
public void GetApexClassesReferencingAGivenClassReturnsClassNames() { var classes = ApexTestFinder.GetApexClassesReferencingAGivenClass(new[] { "class NotATestClass { Foo x; }", "@isTest class ClassWithNoReferencesToFoo { /* Foo x = commented out */ }", "@isTest class MyClass { void Test() { Foo x = new Foo(); } }", "@isTest class NotMyClass { void Test() { FooBar x = new FooBar(); } }", }, "Foo"); Assert.AreEqual(1, classes.Length); Assert.AreEqual("MyClass", classes[0]); }