public void TestGetTypesMethod_SearchingClerkType_ReturnsTypeName() { var assembly = Assembly.LoadFrom("class_library.dll"); var namespaceName = AssemblyBrowser.GetNamespaces(assembly)[0].MemberName; var receivedTypesList = AssemblyBrowser.GetNamespaceTypes(assembly, namespaceName); Assert.IsTrue(receivedTypesList.Find(item => item.MemberName == "Clerk") != null); }
public void TestGetNamespacesMethod_ReturnsNamespaceName() { var assembly = Assembly.LoadFrom("class_library.dll"); var receivedNamespaceName = AssemblyBrowser.GetNamespaces(assembly)[0].MemberName; var expectedNamespaceName = "classes_library"; Assert.AreEqual(expectedNamespaceName, receivedNamespaceName, ":=("); }
public void Setup() { string path = @"C:\Users\dauks\source\repos\Spp_Lab3_Assembly_Browser\TestLib\bin\Debug\TestLib.dll"; // GetType().Assembly.Location AssemblyBrowser browser = new AssemblyBrowser(); _result = browser.GetNamespaces(path); }
public void TestExtendedTask_SearchingExtensionMethod_ReturnsExtensionMethodSignature() { var assembly = Assembly.LoadFrom("class_library.dll"); var namespaceName = AssemblyBrowser.GetNamespaces(assembly)[0].MemberName; var electricianType = AssemblyBrowser.GetNamespaceTypes(assembly, namespaceName) .Find(item => item.MemberName == "Electrician").MemberName; var receivedMethodSignature = AssemblyBrowser.GetTypeMembers(assembly, electricianType) .Find(item => item.MemberName.Contains("CountTools")).MemberName; var expectedMethodSignature = "(extension) public static Int32 CountTools()"; Assert.AreEqual(expectedMethodSignature, receivedMethodSignature, ":'-("); }
public void TestGetTypeMembersMethod_SearchingMethod_ReturnsMethodSignature() { var assembly = Assembly.LoadFrom("class_library.dll"); var namespaceName = AssemblyBrowser.GetNamespaces(assembly)[0].MemberName; var electricianType = AssemblyBrowser.GetNamespaceTypes(assembly, namespaceName) .Find(item => item.MemberName == "Electrician").MemberName; var receivedMethodSignature = AssemblyBrowser.GetTypeMembers(assembly, electricianType) .Find(item => item.MemberName.Contains("AddWorker")).MemberName; var expectedMethodSignature = "public virtual String AddWorker()"; Assert.AreEqual(expectedMethodSignature, receivedMethodSignature, ":'-("); }
public void TestGetTypeMembersMethod_SearchingStringProperty_ReturnsPropertyDescription() { var assembly = Assembly.LoadFrom("class_library.dll"); var namespaceName = AssemblyBrowser.GetNamespaces(assembly)[0].MemberName; var clerkType = AssemblyBrowser.GetNamespaceTypes(assembly, namespaceName) .Find(item => item.MemberName == "Clerk").MemberName; var receivedPropertyDescription = AssemblyBrowser.GetTypeMembers(assembly, clerkType) .Find(item => item.MemberName.Contains("PassNum")).MemberName; var expectedPropertyDescription = "PassNum: String"; Assert.AreEqual(expectedPropertyDescription, receivedPropertyDescription, ":-("); }
public AssemblyResult GetResult(string filename) { return(_browser.GetNamespaces(filename)); }