Bugs and Missing Features with Team System Unit Testing: Part I

My blog has moved. You can view this post at the following address: http://www.osherove.com/blog/2006/1/25/bugs-and-missing-features-with-team-system-unit-testing-part.html
Published Wednesday, January 25, 2006 2:22 PM by RoyOsherove

Comments

Wednesday, January 25, 2006 8:06 AM by Jamie Cansdale

# re: Bugs and Missing Features with Team System Unit Testing: Part I

"Some Message" is actualy the assert message if the expection is not thrown. For example:

[ExpectedException(typeof(InvalidOperationException),"Expected InvalidOperationException to be thrown")]
Wednesday, January 25, 2006 8:43 AM by Antony Marcano

# re: Bugs and Missing Features with Team System Unit Testing: Part I

Jamie wrote:

<blockquote>
"Some Message" is actualy the assert message if the expection is not thrown. For example:

[ExpectedException(typeof(InvalidOperationException),"Expected InvalidOperationException to be thrown")]
</blockquote>
------------------

Although this may be true for Team System, isn't the case with NUnit.
Wednesday, January 25, 2006 10:13 AM by Roy Osherove

# re: Bugs and Missing Features with Team System Unit Testing: Part I

Jamie:
You'd think that, but even if that's the case, that feature does not work (i.e: you don't see that message written anywhere if the test fails...)
Wednesday, January 25, 2006 11:12 PM by David M. Kean

# re: Bugs and Missing Features with Team System Unit Testing: Part I

> they just want to use the simplest thing that works

I would prefer the QA tested for the correct exception, rather than the simplest thing that worked.

Regarding testing the message - you would start having issues with localization if that was the case. I would like the ability to run some sort of RegEx over the exception message.
Friday, January 27, 2006 11:01 AM by Roy Osherove

# re: Bugs and Missing Features with Team System Unit Testing: Part I

David:
The QA is not the one doing Test Driven Development- that's why it's called "Developer Testing".
However, I agree about the localization issues that can arise. There are better ways to check for the message ina multi localized way. My issue was that is the quality tools in VSTS want to be a NUnit killer, they should start out with the basic NUnit features and make them work first.
Monday, October 2, 2006 4:43 PM by Todd

# re: Bugs and Missing Features with Team System Unit Testing: Part I

Another oversight in TS Unit testing that may cause some hideous bugs is that the Assert class does not override the static Object Equals() method. A developer may write: Assert.Equals(expected, actual); In a unit test expecting that an assertion would be raised and instead it does nothing since Object.Assert() just returns true or false and allowing the unit test to pass. While this code would compile for TS, NUnit & MbUnit, both NUnit and MbUnit override the Assert.Equals() method of object and correctly make your unit test fail with "Assert.Equals should not be used for Assertions"
Thursday, October 19, 2006 2:44 PM by Tom Marsh

# re: Bugs and Missing Features with Team System Unit Testing: Part I

Todd, thanks for pointing out the oversight. I'll file a bug for us to consider matching teh behavior of NUnit and MbUnit for Assert.Equals.