private void CallStringAssertMethod(AssertStringTwoArgDelegate assertMethod, string stringToTest1, string stringToTest2) { try { assertMethod.Invoke(stringToTest1, stringToTest2); } catch (AssertionFailedException ex) { mAssertFailMessage = ex.Message; mAssertType = assertMethod.Method.Name; TestDebugInfo("WaitOne End", MessageType.Admin, mAssertFunction); autoEvent.Set(); } }
protected void AssertString(string method, string stringToTest1, string stringToTest2) { AssertStringTwoArgDelegate assertDelegate = null; switch (method) { case "AreEqual": assertDelegate = new AssertStringTwoArgDelegate(Assert.AreEqual <string>); break; } if (assertDelegate != null) { CallStringAssertMethod(assertDelegate, stringToTest1, stringToTest2); } }