public void ReturnsNamespacesInParentFirstOrder() { Data.MemberData data = GetMember("namespace N1.N2 { class Parent { } }", 1); INamespaceSymbol[] containingNamespaces = data.GetContainingNamespaces().ToArray(); Assert.True(containingNamespaces.Length == 2 && containingNamespaces[0].Name == "N1" && containingNamespaces[1].Name == "N2"); }
public void CanReturnSingleNamespace() { Data.MemberData data = GetMember("namespace N1 { class Parent { } }", 1); INamespaceSymbol[] containingNamespaces = data.GetContainingNamespaces().ToArray(); Assert.True(containingNamespaces.Length == 1 && containingNamespaces[0].Name == "N1"); }
public void ReturnsEmpty_When_IsNotInNamespace() { Data.MemberData data = GetMember("class Test { }"); INamespaceSymbol[] containingNamespaces = data.GetContainingNamespaces().ToArray(); Assert.True(containingNamespaces.Length == 0); }
public void CanReturnMultipleNamespaces() { Data.MemberData data = GetMember("namespace N1.N2 { class Parent { } }", 1); INamespaceSymbol[] containingNamespaces = data.GetContainingNamespaces().ToArray(); Assert.True(containingNamespaces.Length == 2 && containingNamespaces.Any(t => t.Name == "N1") && containingNamespaces.Any(t => t.Name == "N2")); }