Exemple #1
0
        public void RunInstanceFunction()
        {
            MethodRunnerTester vTester = new MethodRunnerTester(1);
            int vActual = (int)MethodRunner.RunInstance(vTester, "Function", new object[] { 2, 3 });

            Assert.AreEqual(16, vActual, "Wrong result for instance function");
        }
Exemple #2
0
        public void RunStaticVoidFunction()
        {
            int vActual = 0;

            object[] vParams = new object[] { 2, 3, vActual };
            MethodRunner.RunStatic(typeof(MethodRunnerTester), "StaticVoidFunction", vParams);
            Assert.AreEqual(20, vParams[2], "Wrong result for instance function");
        }
Exemple #3
0
        public void RunInstanceVoidFunction()
        {
            MethodRunnerTester vTester = new MethodRunnerTester(2);
            int vActual = 0;

            object[] vParams = new object[] { 2, 3, vActual };
            MethodRunner.RunInstance(vTester, "VoidFunction", vParams);
            Assert.AreEqual(12, vParams[2], "Wrong result for void instance function");
        }
Exemple #4
0
 public void RunNonExistingStaticMethod()
 {
     MethodRunner.RunStatic(typeof(MethodRunnerTester), "NonExistingMethod", null);
 }
Exemple #5
0
        public void RunNonExistingMethod()
        {
            MethodRunnerTester vTester = new MethodRunnerTester(1);

            MethodRunner.RunInstance(vTester, "NonExistingMethod", null);
        }
Exemple #6
0
        public void RunStaticFunction()
        {
            int vActual = (int)MethodRunner.RunStatic(typeof(MethodRunnerTester), "StaticFunction", new object[] { 2, 3 });

            Assert.AreEqual(25, vActual, "Wrong result for instance function");
        }