Monday, November 18, 2013

[TestMethod] public static void IAmInvisible()

Just spent a little time debugging some MSTests I was trying to add to a project, which just weren't showing up in the Test Explorer. Most of the 'help these tests don't show up' info out there is because someone is trying to add a new project, but in this case I was adding a new class to an existing project.

Eventually I tried adding a new set of tests identical to some working tests, and editing them bit by bit to look like my failing ones. Perhaps it should have been more obvious, but the offending difference was that I had marked the new tests as Static - that doesn't seem to be allowed, and I can't even find that restriction mentioned anywhere. I guess most people never try it?

No comments: