Beispiel #1
0
        public void TestCallAmbiguous()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] arg    = new object[] { 1 };
            object   result = _si.Invoke("Sum", arg);
        }
Beispiel #2
0
        public void TestCallV3()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] arg    = new object[] { 1, 2, 3, 4 };
            object   result = _si.Invoke("Sum", arg);

            Assert.AreEqual("v3", result);
        }
Beispiel #3
0
        public void TestOptVarArgsOmitAll()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] args   = new object[] { 1 };
            object   result = _si.Invoke("OptAndVarArgs", args);

            Assert.AreEqual("4.1", result);
        }
Beispiel #4
0
        public void TestVarArgsMoreArg()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] args   = new object[] { 1, 2, 3, 4, 5 };
            object   result = _si.Invoke("VarArgs", args);

            Assert.AreEqual("3.2", result);
        }
Beispiel #5
0
        public void TestOptArgOmitArg()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] args   = new object[] { 1, 2 };
            object   result = _si.Invoke("OptionalArgs", args);

            Assert.AreEqual("2.2", result);
        }
Beispiel #6
0
        public void TestNormalErr()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] args   = new object[] { 1, 2 };
            object   result = _si.Invoke("Normal", args);

            Assert.AreEqual("1", result);
        }
Beispiel #7
0
        public void TestOptVarArgsProvideOptMoreVarArg()
        {
            ISmartInvoker _si = CreateSmartInvoker();

            object[] args   = new object[] { 1, 2, 3, 4, 5 };
            object   result = _si.Invoke("OptAndVarArgs", args);

            Assert.AreEqual("4.3", result);
        }