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

            object[] arg    = new object[] { 1 };
            object   result = _si.Invoke("Sum", arg);
        }
示例#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);
        }
示例#3
0
        public void TestOptVarArgsOmitAll()
        {
            ISmartInvoker _si = CreateSmartInvoker();

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

            Assert.AreEqual("4.1", result);
        }
示例#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);
        }
示例#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);
        }
示例#6
0
        public void TestNormalErr()
        {
            ISmartInvoker _si = CreateSmartInvoker();

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

            Assert.AreEqual("1", result);
        }
示例#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);
        }