Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Martinez <joelmartinez@gmail.com>2018-07-02 22:28:53 +0300
committerGitHub <noreply@github.com>2018-07-02 22:28:53 +0300
commita8ae91329697a7e43540d23520b1332172653b40 (patch)
treea7b1e0195835f34f93aefbc682f1a9bea3a6416a /mdoc/mdoc.Test/BasicTests.cs
parent03edf10b03e5136508dd8b8bdb21b55af650a819 (diff)
parentb4d58f0396f18bf594394359d20f94e71cc926d4 (diff)
Merge branch 'master' into mdoc-assemble-single-framework
Diffstat (limited to 'mdoc/mdoc.Test/BasicTests.cs')
-rw-r--r--mdoc/mdoc.Test/BasicTests.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/mdoc/mdoc.Test/BasicTests.cs b/mdoc/mdoc.Test/BasicTests.cs
index c06642c7..1d10d038 100644
--- a/mdoc/mdoc.Test/BasicTests.cs
+++ b/mdoc/mdoc.Test/BasicTests.cs
@@ -57,5 +57,24 @@ namespace mdoc.Test
{
return ReadXDocument(xml).ToString();
}
+
+ protected MethodDefinition GetMethod(TypeDefinition testclass, Func<MethodDefinition, bool> query)
+ {
+ var methods = testclass.Methods;
+ var member = methods.FirstOrDefault(query)?.Resolve();
+ if (member == null)
+ throw new Exception("Did not find the member in the test class");
+ return member;
+ }
+
+ protected MethodDefinition GetMethod(Type type, Func<MethodDefinition, bool> query)
+ {
+ return GetMethod(GetType(type), query);
+ }
+
+ protected MethodDefinition GetMethod(Type type, string name)
+ {
+ return GetMethod(GetType(type), i => i.Name == name);
+ }
}
} \ No newline at end of file