Environment versions
Network:
Windows 2000 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only