Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I mark an unit test method as obsolete, or should I keep the method at all?

I have some test methods that are no longer needed, could there be any reason to keep those tests and mark them as obsolete (if so, is using 'obsolete' method attribute a proper way to do that)? Or should I just simply remove them?

like image 428
AsifM Avatar asked Dec 04 '22 03:12

AsifM


1 Answers

Assuming you are using MsTest you have several options.

  1. Add the [Ignore] attribute to the [TestMethod]
  2. Remove the [TestMethod] Attribute
  3. Remove the code
  4. // the code :)

If you're really sure you won't need it anymore, i'd remove it.

like image 70
chrjs Avatar answered Jan 19 '23 01:01

chrjs