Exemplo n.º 1
0
        public void testResultDetailsInconclusive()
        {
            var result = new TestResult();

            result.TestStarted("testMethod");

            Assert.AreEqual(1, result.Details.Count);

            Assert.IsTrue(result.Details[0].Inconclusive);
            Assert.IsFalse(result.Details[0].Success);
            Assert.AreEqual("testMethod", result.Details[0].Name);
            Assert.AreEqual("testMethod inconclusive", result.Details[0].Message);
            Assert.IsNull(result.Details[0].Exception);
        }
Exemplo n.º 2
0
        public void testResultDetailsFailure()
        {
            var result = new TestResult();

            result.TestStarted("testMethod");
            result.TestFailed(new Exception());

            Assert.AreEqual(1, result.Details.Count);

            Assert.IsFalse(result.Details[0].Inconclusive);
            Assert.IsFalse(result.Details[0].Success);
            Assert.AreEqual("testMethod", result.Details[0].Name);
            Assert.AreEqual("testMethod failed", result.Details[0].Message);
            Assert.AreEqual("Exception of type 'System.Exception' was thrown.", result.Details[0].Exception.Message);
        }
Exemplo n.º 3
0
        public void testResultDetailsTwoResults()
        {
            var result = new TestResult();

            result.TestStarted("testMethod");
            result.TestSucceeded();

            result.TestStarted("testBrokenMethod");
            result.TestFailed(new Exception());

            Assert.AreEqual(2, result.Details.Count);

            Assert.IsFalse(result.Details[0].Inconclusive);
            Assert.IsTrue(result.Details[0].Success);
            Assert.AreEqual("testMethod", result.Details[0].Name);
            Assert.IsNull(result.Details[0].Exception);

            Assert.IsFalse(result.Details[1].Inconclusive);
            Assert.IsFalse(result.Details[1].Success);
            Assert.AreEqual("testBrokenMethod", result.Details[1].Name);
            Assert.IsNotNull(result.Details[1].Exception);
        }
Exemplo n.º 4
0
        public void testResultDetailsSuccessfulExpectedException()
        {
            var result = new TestResult();

            result.TestStarted("testMethod");
            result.TestSucceeded(new Exception("Expected exception"));

            Assert.AreEqual(1, result.Details.Count);

            Assert.IsFalse(result.Details[0].Inconclusive);
            Assert.IsTrue(result.Details[0].Success);
            Assert.AreEqual("testMethod", result.Details[0].Name);
            Assert.AreEqual("testMethod succeeded", result.Details[0].Message);
            Assert.IsNotNull(result.Details[0].Exception);
        }