Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
TDD - Test for failed case only?
Message
From
24/05/2007 07:36:19
 
 
To
24/05/2007 02:55:30
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
MS SQL Server
Miscellaneous
Thread ID:
01228156
Message ID:
01228166
Views:
20
If the value for FieldA come from some sort of input at runtime, then yes, you should write a failure test and verify that the result you get is the one you wanted (error code and/or exception).

If the value should be filled by a calling method at design time, then I don't think that you should write a test for that. The test for the calling method (the one that forgot to initialize FieldA) should trap this development error.

HTH

>WHile creating test, should we write test code for pass and also fail scenario?
>
>For example, If my class must not accept ZERO value for fieldA. I write test to check is the rule passed. Should I write test for scenario the test should fail?
Previous
Reply
Map
View

Click here to load this message in the networking platform