NUnit.Framework.Assertions.AssertMultipleTests.CheckResult(string, ResultState, params string[])

Here are the examples of the csharp api class NUnit.Framework.Assertions.AssertMultipleTests.CheckResult(string, ResultState, params string[]) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

6 Examples 7

1. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[TestCase("TwoAsserts_FirstAssertFails", "RealPart")]
        [TestCase("TwoAsserts_SecondAssertFails", "ImaginaryPart")]
        [TestCase("TwoAsserts_BothAssertsFail", "RealPart", "ImaginaryPart")]
        [TestCase("NestedBlock_FirstAssertFails", "Expected: 5")]
        [TestCase("NestedBlock_TwoAssertsFail", "Expected: 5", "ImaginaryPart")]
        [TestCase("TwoNestedBlocks_FirstAssertFails", "Expected: 5")]
        [TestCase("TwoNestedBlocks_TwoAssertsFail", "Expected: 5", "ImaginaryPart")]
        [TestCase("MethodCallsFail", "Message from Assert.Fail")]
        [TestCase("MethodCallsFailAfterTwoAssertsFail", "Expected: 5", "ImaginaryPart", "Message from Assert.Fail")]
#if ASYNC
        [TestCase("TwoAsserts_BothAssertsFail_Async", "RealPart", "ImaginaryPart")]
        [TestCase("TwoNestedBlocks_TwoAssertsFail_Async", "Expected: 5", "ImaginaryPart")]
#endif
        public void AssertMultipleFails(string methodName, params string[] assertionMessageRegex)
        {
            CheckResult(methodName, ResultState.Failure, assertionMessageRegex);
        }

2. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[TestCase("ExceptionThrown")]
        [TestCase("ExceptionThrownAfterTwoFailures", "Failure 1", "Failure 2", "Simulated Error")]
        public void AssertMultipleErrorTests(string methodName, params string[] assertionMessageRegex)
        {
            ITestResult result = CheckResult(methodName, ResultState.Error, assertionMessageRegex);
            Assert.That(result.Message, Does.StartWith("System.Exception : Simulated Error"));//
        }

3. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[Test]
        public void AssertIgnoreInBlockThrowsException()
        {
            ITestResult result = CheckResult("AssertIgnoreInBlock", ResultState.Error);
            Assert.That(result.Message, Contains.Substring("Assert.Ignore may not be used in a multiple assertion block."));
        }

4. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[Test]
        public void AssumptionInBlockThrowsException()
        {
            ITestResult result = CheckResult("AssumptionInBlock", ResultState.Error);
            Assert.That(result.Message, Contains.Substring("Assume.That may not be used in a multiple assertion block."));
        }

5. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[Test]
        public void AssertPassInBlockThrowsException()
        {
            ITestResult result = CheckResult("AssertPassInBlock", ResultState.Error);
            Assert.That(result.Message, Contains.Substring("Assert.Pass may not be used in a multiple assertion block."));
        }

6. Example

Project: nunit
Source File: AssertMultipleTests.cs
View license
[Test]
        public void AssertInconclusiveInBlockThrowsException()
        {
            ITestResult result = CheckResult("AssertInconclusiveInBlock", ResultState.Error);
            Assert.That(result.Message, Contains.Substring("Assert.Inconclusive may not be used in a multiple assertion block."));
        }