Exemplo n.º 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));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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");
        }