Ignoring Tests
You can instruct Typemock Isolator to ignore a test by adding one of the following attributes to the unit test method:
Attribute |
Description |
[DontRun] |
Typemock Isolator skips the test. However, the test framework runs the test. |
[Ignore] |
Both Typemock Isolator and the test framework skip the test. |
C# [AttributeUsage(AttributeTargets.Method)] public class DontRunAttribute : System.Attribute { } [DontRun] [TestMethod] public void SimpleTestUsingMessageBox() { // Arrange Isolate.WhenCalled(()=>MessageBox.Show(null)).WillReturn(DialogResult.OK); // Act MessageBox.Show("This is a message"); // Assert Isolate.Verify.WasCalledWithExactArguments(()=>MessageBox.Show("This is a message")); }