MSTest fails to mention ignored tests
14 November, 2008 § Leave a comment
The other day I was writing some unit tests for a project I was working on. At the time, these tests contained some credentials that I both didn’t want to check-in and also didn’t want to break the build at a later date if I ever changed my password.
The test looked like this:
[Test] public void TestLogIn() { var username = "j.wein"; var password = "123456"; var authenticated = Directory.Authenticate( username, password ); Assert.IsTrue( authenticated ); }
I was writing the tests to track down a bug. Thus I wanted the code to go against a real LDAP directory, not a double. As I was getting ready to check it in, I changed the test to be ignored. This is the syntax:
[Test, Ignore] public void TestLogIn() { ... }
When I ran the tests, the number of tests ran decreased by one, and there was no mention of a test that was skipped or ignored.
On the other hand, nUnit handled an ignored test like expected. When the test run had finished, it said that 7 tests succeeded and one was ignored.
Leave a Reply