How to prevent expected exceptions from breaking the debug test run?
问题 When running MSTEST unit tests in debug mode, the execution stops in every expected exception that is thrown. My test looks like this [TestMethod()] [ExpectedException(typeof(ArgumentNullException))] public void ShouldThrowExceptionWhenPassingNull() { object data = null; target.CheckNull(data); } the target method looks like this: public void CheckNull(object data) { if (ReferenceEquals(null, data)) { throw new ArgumentNullException("data"); } } // test run breaks here: ArgumentNullException