Exemplo n.º 1
0
        public void TestLogAllTypesOfOutcome()
        {
            var iteration = StfIterationNo;

            switch (iteration)
            {
            case 1:
                StfAssert.IsTrue("Pass", true);
                break;

            case 2:
                StfAssert.IsTrue("Fail", false);
                break;

            case 3:
                StfAssert.IsInconclusive("Inconclusive", "Inconclusive");
                break;

            case 4:
                StfLogger.LogWarning("Warning", "Warning");
                break;

            case 5:
                StfLogger.LogError("Error", "Error");
                break;
            }
        }
Exemplo n.º 2
0
 public void TestMethodAssertInconclusive()
 {
     Assert.IsTrue(StfAssert.IsInconclusive("Check is inconclusive", "Inconclusive"));
     StfAssert.AreEqual("Current inconclusives", 1, StfAssert.CurrentInconclusives);
     StfAssert.AreEqual("Current failures", 0, StfAssert.CurrentFailures);
     StfAssert.AreEqual("Current passes", 2, StfAssert.CurrentPasses);
 }
Exemplo n.º 3
0
        /// <summary>
        /// The do clean up and throw inconclusive.
        /// </summary>
        /// <param name="message">
        /// The message.
        /// </param>
        private void DoCleanUpAndThrowInconclusive(string message)
        {
            // gotta diable the throwing of the inconclusive exception from StfAsserter - othervise BaseTestCleanup() wont be called
            var oldEnableNegativeTesting = StfAssert.EnableNegativeTesting;

            StfAssert.EnableNegativeTesting = true;
            StfAssert.IsInconclusive("TestCleanup", message);
            StfAssert.EnableNegativeTesting = oldEnableNegativeTesting;

            // this wont call the test script cleanup - fair enough as the test script test initialize wasn't called --> symmetry is maintained
            BaseTestCleanup();

            throw new AssertInconclusiveException("Ignoring row");
        }