Example #1
0
 public void AssemblyApiWithOneNamespace()
 {
     var api = new AssemblyApi(new List<NamespaceDefinition> {new NamespaceDefinition("MyNamespace")});
     Assert.IsNotNull(api.GetNamespaces());
     Assert.AreEqual(1, api.GetNamespaces().Count());
     Assert.AreEqual("MyNamespace", api.GetNamespaces().First().Name);
 }
Example #2
0
 public void ApiTest()
 {
     var myNamespace = new NamespaceDefinition();
     myNamespace.AddType(typeof (MyClass));
     var api = new AssemblyApi(new List<NamespaceDefinition> {myNamespace});
     var namespaces = api.GetNamespaces().ToList();
     Assert.AreEqual(1, namespaces.Count);
     foreach (var nspace in namespaces)
     {
         var classes = nspace.Types.ToList();
         Assert.AreEqual(1, classes.Count);
         foreach (var c in classes)
         {
             var members = c.GetPublicMembersSignatures().ToList();
             Assert.AreEqual(5, members.Count);
         }
     }
 }
Example #3
0
 public void AssemblyApiWithEmptyList()
 {
     var api = new AssemblyApi(new List<NamespaceDefinition>());
     Assert.IsNotNull(api.GetNamespaces());
     Assert.AreEqual(0, api.GetNamespaces().Count());
 }