Using MSTest how can I verify the exact error message coming from a test method? I know [ExpectedException(typeof(ApplicationException), error msg)] doesn\'t co
Update: Oops.. see that you want this in MSTest. Sorry. Speed read & Misled by your title.
Try this extension project from Callum Hibbert and see if it works.
Old response:
You can do this with NUnit 2.4 and above. See documentation of ExpectedException here
[ExpectedException( typeof( ArgumentException), ExpectedMessage="unspecified", MatchType=MessageMatch.Contains )]
public void TestMethod()
{
...
MatchType can be Exact (default), Contains or Regex.. which pretty much handles the 80% use-case. There is also an advanced exception handler method approach if the verification gets too complex.. never used it personally.. didn't need it yet.