Esempio n. 1
0
        public void TestInvoke2()
        {
            var one = ActionInvoker.Create(typeof(Tester).GetMethod("Two"));

            one.Invoke(_tester, 0, string.Empty);
            Assert.That(_tester.HasInvoked, Is.True);
        }
Esempio n. 2
0
        public void TestStaticInvoke1()
        {
            var setStaticInvoked = ActionInvoker.Create(typeof(Tester).GetMethod("SetInvoked"));

            setStaticInvoked.Invoke(true);
            Assert.That(Tester.StaticHasInvoked, Is.True);
        }
Esempio n. 3
0
        public void TestInvoke1()
        {
            var one = ActionInvoker.Create(typeof(Tester).GetMethod("One"));

            one.Invoke(_tester, 0);
            Assert.That(_tester.HasInvoked, Is.True);
        }
Esempio n. 4
0
 public void TestInvokeFunc()
 {
     Assert.That(
         () => ActionInvoker.Create(typeof(TestActionInvoker).GetMethod(nameof(AFunc))),
         Throws.TypeOf <NotSupportedException>()
         );
 }
Esempio n. 5
0
 public void TestThatFiveParametersIsTooMany()
 {
     Assert.That(
         () => ActionInvoker.Create(typeof(TestActionInvoker).GetMethod(nameof(FiveParameters))),
         Throws.TypeOf <NotSupportedException>()
         );
 }
Esempio n. 6
0
        public void TestInvoke0()
        {
            var one = ActionInvoker.Create(typeof(Tester).GetMethod(nameof(Tester.Zero)));

            one.Invoke(_tester);
            Assert.That(_tester.HasInvoked, Is.True);
        }
Esempio n. 7
0
        public void TestStaticInvokeThunk()
        {
            var setTrueStaticInvoked = ActionInvoker.Create(typeof(Tester).GetMethod(nameof(Tester.SetInvokedTrue)));

            setTrueStaticInvoked.Invoke();
            Assert.That(Tester.StaticHasInvoked, Is.True);
        }