TestSetup

Apr 8, 2010 at 1:21 AM

This is very cool stuff & great work.

I think I only see [TestSetup] and [TestCleanup] run once, before and after all the tests, but I thought I read on the home page that they ran before and after each test.  I thought that before and after each test would be better, but which is the right way?

Thanks!

Coordinator
Apr 9, 2010 at 1:58 AM

Hi Tuzen, thanks for trying out the library. The TestSetup and TestCleanup methods were always meant to be run at the beginning and end of the entire test class. The idea is that you can separate your tests into separate classes to keep things organized :-) however, you are right that the verbiage is vague ... I will clarify that.

In the meantime, I added two more attributes [TestPre] and [TestPost] which behave as you are describing. I checked it in with changeset (44195) ... test it out and let me know if it works well for you and I will package it up and release v1.3 with that feature.  

Let me know if you have any other requests or feedback :-)

 

Apr 15, 2010 at 12:39 AM

Ah, thanks for the clarification.  I just tried out 44195, and it's working great!  Nice!

Apr 16, 2010 at 1:15 AM

I may have found something unexpected; I'm not sure.  I see now that the TestStatusReporter is calling Fail() and End() for the new methods like [TestPost].  My idea was to collect all the results and display them at the end.  Inside my Reporter it might be nice to have a MethodAttribute property to only count [TestMethod], but I could also just annotate the MethodName to do this.  But, is there a nice way to see all tests completed?

Thanks!