Ejemplo n.º 1
0
        public void Combinatorial_Test_All_1_Argument_Dispatch(
            [Values("A", "B", "C", "D")] string arg1)
        {
            A a1 = DispatchTestHelper.CreateInstance(arg1);

            DispatchTestHelper check = new DispatchTestHelper();

            Assert.AreEqual(arg1, check.FF1(a1));
        }
Ejemplo n.º 2
0
        public void MultiMethod_Action_And_Function_Wrappers_Will_Dispatch_To_Correct_Method()
        {
            DispatchTestHelper check = new DispatchTestHelper();

            check.MM1(new D());
            Assert.AreEqual("D", check.LastResult);

            check.MM2(new D(), new D());
            Assert.AreEqual("DD", check.LastResult);

            check.MM3(new D(), new D(), new D());
            Assert.AreEqual("DDD", check.LastResult);

            check.MM4(new D(), new D(), new D(), new D());
            Assert.AreEqual("DDDD", check.LastResult);

            Assert.AreEqual("D", check.FF1(new D()));
            Assert.AreEqual("DD", check.FF2(new D(), new D()));
            Assert.AreEqual("DDD", check.FF3(new D(), new D(), new D()));
            Assert.AreEqual("DDDD", check.FF4(new D(), new D(), new D(), new D()));
        }