public void TestInvoke2() { var one = ActionInvoker.Create(typeof(Tester).GetMethod("Two")); one.Invoke(_tester, 0, string.Empty); Assert.That(_tester.HasInvoked, Is.True); }
public void TestStaticInvoke1() { var setStaticInvoked = ActionInvoker.Create(typeof(Tester).GetMethod("SetInvoked")); setStaticInvoked.Invoke(true); Assert.That(Tester.StaticHasInvoked, Is.True); }
public void TestInvoke1() { var one = ActionInvoker.Create(typeof(Tester).GetMethod("One")); one.Invoke(_tester, 0); Assert.That(_tester.HasInvoked, Is.True); }
public void TestInvokeFunc() { Assert.That( () => ActionInvoker.Create(typeof(TestActionInvoker).GetMethod(nameof(AFunc))), Throws.TypeOf <NotSupportedException>() ); }
public void TestThatFiveParametersIsTooMany() { Assert.That( () => ActionInvoker.Create(typeof(TestActionInvoker).GetMethod(nameof(FiveParameters))), Throws.TypeOf <NotSupportedException>() ); }
public void TestInvoke0() { var one = ActionInvoker.Create(typeof(Tester).GetMethod(nameof(Tester.Zero))); one.Invoke(_tester); Assert.That(_tester.HasInvoked, Is.True); }
public void TestStaticInvokeThunk() { var setTrueStaticInvoked = ActionInvoker.Create(typeof(Tester).GetMethod(nameof(Tester.SetInvokedTrue))); setTrueStaticInvoked.Invoke(); Assert.That(Tester.StaticHasInvoked, Is.True); }