예제 #1
0
        public void IsUnitTestAssertExceptionReturnsFalseIfExceptionIsNotAssertException()
        {
            var exception = new NotImplementedException();

            UTF.UnitTestOutcome outcome = UTF.UnitTestOutcome.Unknown;

            Assert.IsFalse(exception.TryGetUnitTestAssertException(out outcome, out var exceptionMessage, out var stackTraceInfo));
        }
예제 #2
0
        public void IsUnitTestAssertExceptionReturnsTrueIfExceptionIsAssertException()
        {
            var exception = new UTF.AssertInconclusiveException();

            UTF.UnitTestOutcome outcome = UTF.UnitTestOutcome.Unknown;

            Assert.IsTrue(exception.TryGetUnitTestAssertException(out outcome, out var exceptionMessage, out var stackTraceInfo));
        }
예제 #3
0
        public void IsUnitTestAssertExceptionSetsOutcomeAsFailedIfAssertFailedException()
        {
            var exception = new UTF.AssertFailedException("Dummy Message", new NotImplementedException("notImplementedException"));

            UTF.UnitTestOutcome outcome = UTF.UnitTestOutcome.Unknown;

            exception.TryGetUnitTestAssertException(out outcome, out var exceptionMessage, out var stackTraceInfo);

            Assert.AreEqual(UTF.UnitTestOutcome.Failed, outcome);
            Assert.AreEqual("Dummy Message", exceptionMessage);
        }
예제 #4
0
        public void IsUnitTestAssertExceptionSetsOutcomeAsInconclusiveIfAssertInconclusiveException()
        {
            var exception = new UTF.AssertInconclusiveException("Dummy Message", new NotImplementedException("notImplementedException"));

            UTF.UnitTestOutcome outcome          = UTF.UnitTestOutcome.Unknown;
            string exceptionMessage              = null;
            StackTraceInformation stackTraceInfo = null;

            exception.TryGetUnitTestAssertException(out outcome, out exceptionMessage, out stackTraceInfo);

            Assert.AreEqual(UTF.UnitTestOutcome.Inconclusive, outcome);
            Assert.AreEqual("Dummy Message", exceptionMessage);
        }
예제 #5
0
        public void IsUnitTestAssertExceptionSetsOutcomeAsFailedIfAssertFailedException()
        {
            var exception = new UTF.AssertFailedException("Dummy Message", new NotImplementedException("notImplementedException"));

            UTF.UnitTestOutcome outcome          = UTF.UnitTestOutcome.Unknown;
            string exceptionMessage              = null;
            StackTraceInformation stackTraceInfo = null;

            exception.TryGetUnitTestAssertException(out outcome, out exceptionMessage, out stackTraceInfo);

            Assert.AreEqual(outcome, UTF.UnitTestOutcome.Failed);
            Assert.AreEqual(exceptionMessage, "Dummy Message");
        }