public void DoesNotAttemptToMatchInterfaces() { InterfaceType interfaceType = new InterfaceType ( "myInterfaceFqn", "myPackage", "myInterface", "myNamespace" ); Symbols.MapFullyQualifiedNameToType("myInterfaceFqn", interfaceType); ClassType classType = new ClassType ( "myClassFqn", "myPackage", "myClass", "myNamespace", false, interfaces: new[] { new TypeReference("myInterfaceFqn") } ); Symbols.MapFullyQualifiedNameToType("myClassFqn", classType); bool actual = classType.AnyAncestor(Symbols, t => t.Name == "myInterface"); Assert.False(actual); }
public void DoesNotAttemptToMatchInterfaces() { InterfaceType interfaceType = new InterfaceType ( fullyQualifiedName: "myInterfaceFqn", assembly: "myPackage", name: "myInterface" ); Symbols.MapFullyQualifiedNameToType("myInterfaceFqn", interfaceType); ClassType classType = new ClassType ( fullyQualifiedName: "myClassFqn", assembly: "myPackage", name: "myClass", isAbstract: false, interfaces: new[] { "myInterfaceFqn" } ); Symbols.MapFullyQualifiedNameToType("myClassFqn", classType); bool actual = classType.AnyAncestor(Symbols, t => t.Name == "myInterface"); Assert.False(actual); }
public void ReturnsTrueIfAncestorMatches() { ClassType classType = CreateType(true, true); bool actual = classType.AnyAncestor(Symbols, t => t.Name == "myGrandParentType"); Assert.True(actual); }
public void ReturnsFalseIfNoAncestorMatches() { ClassType classType = CreateType(true, true); bool actual = classType.AnyAncestor(Symbols, t => t.Name == "myNephewType"); Assert.False(actual); }
public void ReturnsFalseIfNoAncestorExists() { ClassType classType = CreateType(false, false); bool actual = classType.AnyAncestor(Symbols, t => t.Name != string.Empty); Assert.False(actual); }
public void DoesNotAttemptToMatchSelf() { ClassType classType = CreateType(true, true); bool actual = classType.AnyAncestor(Symbols, t => t.Name == "myClass"); Assert.False(actual); }