Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Is there a way to conditionally exclude a test?
Message
 
 
To
07/03/2013 16:22:52
General information
Forum:
ASP.NET
Category:
Testing and debugging
Environment versions
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01567786
Message ID:
01567809
Views:
41
>I can tell because it violates the rules of good unit and integration tests.
>
>Naomi, you always come up here asking how to do something and frequently try to justify your poor software engineering practices when you're told why you're doing things wrong. Then you usually end up saying something just you said here. Just get the result to look right when there really is no way to tell if it's correct or not. You're doing your employer a disservice, your career a disservice, what you're doing is costing your employer money, and borders on ineptitude. I can almost guarantee at some point, a value will either be incorrectly written or read to the database because your tests are in fact invalid. Then you'll scratch your head for days trying to figure out what's wrong, you'll ask here for help, you'll scratch your head some more. All because it appears the tests are passing but may not acutally be failing.
>

I am listening to what you're saying and in most cases I try to adapt the ideas to the scenarios I am working on at the moment. But I think you're judging from some fundamental point of the view and often give too generalized statements that can not be applied to every situation easily. I also can not always throw away what we all have here and start re-factoring and re-writting because you're saying it's not up to the best standards.

The tests I am writing at the moment need to verify if the procedure produces the expected output based on the current database state. Since we're dealing with the database there is no way to guarantee the exact output several months from now. But if the tests now are returning the values I am expecting then I know that the code works. I need to search if there is a way to put some expiration date for the tests because they may not be valid when the database state will change.

BTW, it's good I raised this issue because I ran a quick search and found

http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.testtools.unittesting.timeoutattribute.timeout.aspx

Unfortunately, again .NET documentation doesn't show an example and I need to search more.
If it's not broken, fix it until it is.


My Blog
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform