public async Task MyTest() { MethodInfo inf = typeof(IntTask).GetMethod("Execute"); var intTask = new IntTask(); Delegate d = inf.CreateDelegate(intTask); var ret = await(Task <object>) d.Method.Invoke(intTask, new object[] { 123 }); }
public async Task Invoking_IntTask_with_param_returns_same_value() { var p = new IntTask(); var result = await p.InvokeTask("Execute", 1); result.Should().Be(1); }