static MethodInfo GetAsyncMethodExampleBodyInfo(ExampleBase baseExample) { const string methodInfoPrivateFieldName = "method"; AsyncMethodExample example = (AsyncMethodExample)baseExample; var info = example.GetType() .GetField(methodInfoPrivateFieldName, BindingFlags.Instance | BindingFlags.NonPublic) .GetValue(example) as MethodInfo; return(info); }
protected override FixtureData BuildFixtureData() { Func <Task> someAsyncAction = DummyMethodAsync; MethodInfo methodInfo = someAsyncAction.Method; ExampleBase someExample = new AsyncMethodExample( methodInfo, "tag1 tag2_more tag3"); string someMethodName = someAsyncAction.Method.Name; return(new FixtureData() { Example = someExample, MethodName = someMethodName, }); }