public void Combinatorial_Test_All_4_Argument_Dispatch( [Values("A", "B", "C", "D")] string arg1, [Values("A", "B", "C", "D")] string arg2, [Values("A", "B", "C", "D")] string arg3, [Values("A", "B", "C", "D")] string arg4) { A a1 = DispatchTestHelper.CreateInstance(arg1); A a2 = DispatchTestHelper.CreateInstance(arg2); A a3 = DispatchTestHelper.CreateInstance(arg3); A a4 = DispatchTestHelper.CreateInstance(arg4); DispatchTestHelper check = new DispatchTestHelper(); string expected = arg1 + arg2 + arg3 + arg4; Assert.AreEqual(expected, check.FF4(a1, a2, a3, a4)); }
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())); }