Paulo Morgado

.NET Development & Architecture

This Blog

Syndication

Search

Tags

News

Unit Test Today! Get Typemock Isolator!

Projects

Books

 

Visitors

Visitor Locations

Community

Email Notifications

Archives

Profile

Disclaimer

The opinions and viewpoints expressed in this site are mine and do not necessarily reflect those of Microsoft, my employer or any community that I belong to. Any code or opinions are offered as is. Products or services mentioned are purchased by me, made available to me by my employer or the manufacturer/vendor which doesn't influence my opinion in any way.

VS REGEX: Commenting Generated Assert Instructions

Visual Studio's Unit Test generator generates a call to Assert.Inconclusive but, usually generates a call to another method of the Assert class. I find that very annoying because, some times, this makes the test fail instead of being reported as inconclusive.

To comment out these extra calls to Assert methods, the following regular expression can be used:

Find what:
{:b*}{Assert\.~(Inconclusive).*\n:b*Assert\.Inconclusive}
Replace with:
\1//\2

Check out the complete list.

Published Sun, Oct 7 2007 23:56 by Paulo Morgado

Comments

# re: VS REGEX: Commenting Generated Assert Instructions@ Monday, October 08, 2007 12:31 AM

The link, Assert.Inconclusive: msdn2.microsoft.com/.../ms123402.aspx, seems incorrect.

Ricky

# re: VS REGEX: Commenting Generated Assert Instructions@ Monday, October 08, 2007 5:06 PM

Thanks Ricky. Solved.

Paulo Morgado

Leave a Comment

(required) 
(required) 
(optional)
(required) 
If you can't read this number refresh your screen
Enter the numbers above: