예제 #1
0
 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");
 }
예제 #2
0
 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");
 }
예제 #3
0
 public void ReturnsEmpty_When_IsNotInNamespace()
 {
     Data.MemberData    data = GetMember("class Test { }");
     INamespaceSymbol[] containingNamespaces = data.GetContainingNamespaces().ToArray();
     Assert.True(containingNamespaces.Length == 0);
 }
예제 #4
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"));
 }