public void TestInstanceMethodWithNoReturnValueAndNoParamsShouldCreateCorrectDelegate()
        {
            var tester = new Tester();
            var methodInfo = typeof(Tester).GetMethod(nameof(tester.NoReturnValueAndNoParams));

            var @delegate = methodInfo.CreateDelegate(tester);

            Assert.AreSame(tester, @delegate.Target);
            Assert.AreEqual(methodInfo, @delegate.Method);
            Assert.IsInstanceOfType(@delegate, typeof(Action));
        }
        public void TestInstanceMethodWhichHasReturnValueAndVariableParamsShouldCreateCorrectDelegate()
        {
            var tester = new Tester();
            var methodInfo = typeof(Tester).GetMethod(nameof(tester.HasReturnValueAndVariableParams));

            var @delegate = methodInfo.CreateDelegate(tester);

            Assert.AreSame(tester, @delegate.Target);
            Assert.AreEqual(methodInfo, @delegate.Method);
            Assert.IsInstanceOfType(@delegate, typeof(Func<int[], FileInfo>));
        }