vendredi 27 février 2015

How to make one test depend on the results of another test?


Let's say there is a utility class that provides some common static methods used everywhere in your code by many other classes.


How would you design your unit tests for the consumers of the utility so that their tests fail if any one of the utility tests do not pass? Can you do it or do you have to check it yourself whether the utility class tests are all green?


For example I have a message-splitter utility that is used (or rather its output) by a message-parser. I'd like to be sure that the message-splitter works correctly before the message-parser gets tested.


I have written tests for both of them but is there a way to make one test depend on the result of some other test?


I couldn't find a suitable tag for this but I'm using Visual Studio's unit test engine.





Aucun commentaire:

Enregistrer un commentaire