Exemplo n.º 1
0
        public void AssemblyTestAssemblyFromSymbol()
        {
            IAssemblySymbol assemblySymbol = TestResource.GetAssemblySymbol();
            AssemblyApiView assembly       = new AssemblyApiView(assemblySymbol);

            Assert.Equal("TestLibrary", assembly.Name);

            Assert.Single(assembly.GlobalNamespace.Namespaces);
        }
Exemplo n.º 2
0
        public void NamespaceTestNonGlobalSomeNamedTypesNonamespacesStringRep()
        {
            AssemblyApiView assembly = new AssemblyApiView(TestResource.GetAssemblySymbol());

            Assert.Equal("TestLibrary", assembly.Name);

            NamespaceApiView globalNamespace = assembly.GlobalNamespace;
            NamespaceApiView nestedNamespace = globalNamespace.Namespaces[0];

            Assert.Contains("namespace TestLibrary {", nestedNamespace.ToString());
        }
Exemplo n.º 3
0
        public void NamespaceTestGlobalNoNamedTypesSomenamespaces()
        {
            AssemblyApiView assembly = new AssemblyApiView(TestResource.GetAssemblySymbol());

            Assert.Equal("TestLibrary", assembly.Name);

            NamespaceApiView globalNamespace = assembly.GlobalNamespace;

            Assert.Empty(globalNamespace.NamedTypes);
            Assert.Single(globalNamespace.Namespaces);
        }
Exemplo n.º 4
0
        public void NamespaceTestNonGlobalSomeNamedTypesNonamespaces()
        {
            AssemblyApiView assembly = new AssemblyApiView(TestResource.GetAssemblySymbol());

            Assert.Equal("TestLibrary", assembly.Name);

            NamespaceApiView globalNamespace = assembly.GlobalNamespace;
            NamespaceApiView nestedNamespace = globalNamespace.Namespaces[0];

            Assert.Equal("TestLibrary", nestedNamespace.Name);

            Assert.NotEmpty(nestedNamespace.NamedTypes);
            Assert.Empty(nestedNamespace.Namespaces);
        }