Causes the test runner to ignore the remainder of the test and mark the test as ignored with a given message
Namespace:
MbUnit.FrameworkAssembly: MbUnit.Framework (in MbUnit.Framework.dll) Version: 2.4.2.1502 (2.4.2.1502)
Syntax
| C# |
|---|
public static void Ignore( string message ) |
| Visual Basic (Declaration) |
|---|
Public Shared Sub Ignore ( _ message As String _ ) |
Parameters
- message
- Type: System..::.String
The message to be shown in the test runner saying why the test was ignored
Remarks
The test is marked ignored by throwing an IgnoreRunException.
Examples
The following code demonstrates Assert.Ignore
CopyC#
using System; using MbUnit.Framework; namespace MbUnitAssertDocs { [TestFixture] public class Ignore_1Argument { // This test is ignored [Test] public void Ignore() { Assert.Ignore("This test was ignored"); } // This test fails because fail is called before ignore [Test] public void Ignore_FailBefore() { Assert.Fail("Fail First"); Assert.Ignore("This test was ignored"); } // This test is ignored because fail is called after ignore [Test] public void Ignore_FailAfter() { Assert.Ignore("This test was ignored"); Assert.Fail("Fail After"); } } }
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if message is null |
