示例#1
0
        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);
        }
示例#2
0
        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,
            });
        }