internal static void FireTestCheckEvent(TestCheck testCheck) { if (TestCheck.OnTestCheck != null) { TestCheck.OnTestCheck(testCheck); } }
public static TestCheck IsNotNull(string description, object value, string format, params object[] args) { var testCheck = new TestCheck(description, null != value ? TestVerdict.Pass : TestVerdict.Fail, string.Format(format, args)); FireTestCheckEvent(testCheck); return(testCheck); }
public static TestCheck IsTrue(string description, bool condition, string format, params object[] args) { var testCheck = new TestCheck(description, condition ? TestVerdict.Pass : TestVerdict.Fail, string.Format(format, args)); FireTestCheckEvent(testCheck); return(testCheck); }
public static TestCheck Pass(string description, string format, params object[] args) { var testCheck = new TestCheck(description, TestVerdict.Pass, string.Format(format, args)); FireTestCheckEvent(testCheck); return(testCheck); }
public static TestCheck IsNotNull(string description, object value, string comment, bool throwOnFailedAssertion = false) { var testCheck = new TestCheck(description, null != value ? TestVerdict.Pass : TestVerdict.Fail, comment); FireTestCheckEvent(testCheck); if (testCheck._verdict == TestVerdict.Fail && throwOnFailedAssertion) { throwTestCheckFailedException(testCheck); } return(testCheck); }
public static TestCheck IsTrue(string description, bool condition, string comment, bool throwOnFailedAssertion = false) { var testCheck = new TestCheck(description, condition ? TestVerdict.Pass : TestVerdict.Fail, comment); FireTestCheckEvent(testCheck); if (testCheck._verdict == TestVerdict.Fail && throwOnFailedAssertion) { throwTestCheckFailedException(testCheck); } return(testCheck); }
private void TestCheck_OnTestCheck(TestCheck testCheck) { if (TestCheckFailuresOnly) { if (testCheck.TestVerdict == Core.TestVerdict.Fail) { _testCheckCollection.Add(testCheck); } } else { _testCheckCollection.Add(testCheck); } if (MaxFailedTestChecks != -1 && getFailedTestChecks().Count() >= MaxFailedTestChecks) { throw new MaxFailedTestChecksException(string.Format( "The maximum number of failed test checks ({0}) has been met or exceeded. " + "Consider increasing the test class's MaxFailedTestChecks property value to a higher number " + "setting it to -1 (disregards max threshold),", MaxFailedTestChecks)); } }
public void TestCheck(QTF.TestCheck testCheck) { // Enter runtime event handler code here }
private static void throwTestCheckFailedException(TestCheck testCheck) { throw new TestCheckFailedException(testCheck); }
/// <summary> /// Exception thrown when a TestClass-derived test check fails and test check exception flag is set to true. /// </summary> /// <param name="testCheck"></param> public TestCheckFailedException(TestCheck testCheck) { this._testCheck = testCheck; }