private void DelegateFuncTest(MethodInfo method) { var facet = new ActionInvocationFacetViaMethod(method, null, null, null, null, false); Assert.IsNotNull(facet.ActionDelegate, method.Name); var parms = method.GetParameters().Select(p => "astring").Cast <object>().ToArray(); Assert.AreEqual(method.Name, facet.ActionDelegate(new TestDelegateClass(), parms)); }
private static void DelegateActionTest(MethodInfo method) { var facet = new ActionInvocationFacetViaMethod(method, null, null, null, null, false, null); var parms = method.GetParameters().Select(p => "astring").Cast <object>().ToArray(); Assert.IsNotNull(facet.ActionDelegate, method.Name); var testObject = new TestDelegateClass(); facet.ActionDelegate.Invoke(testObject, parms); Assert.AreEqual(method.Name, testObject.ActionCalled); }