Exemplo n.º 1
0
 internal static void FireTestCheckEvent(TestCheck testCheck)
 {
     if (TestCheck.OnTestCheck != null)
     {
         TestCheck.OnTestCheck(testCheck);
     }
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
        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);
        }
Exemplo n.º 7
0
        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
 }
Exemplo n.º 9
0
 private static void throwTestCheckFailedException(TestCheck testCheck)
 {
     throw new TestCheckFailedException(testCheck);
 }
Exemplo n.º 10
0
 /// <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;
 }