Click here to Skip to main content
15,901,035 members
Home / Discussions / C#
   

C#

 
QuestionHow to make auto-generated unit tests fail initially? Pin
Jun Du6-Jan-12 10:39
Jun Du6-Jan-12 10:39 
AnswerRe: How to make auto-generated unit tests fail initially? Pin
Not Active6-Jan-12 13:47
mentorNot Active6-Jan-12 13:47 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
OriginalGriff6-Jan-12 23:21
mveOriginalGriff6-Jan-12 23:21 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du7-Jan-12 5:29
Jun Du7-Jan-12 5:29 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Not Active7-Jan-12 5:44
mentorNot Active7-Jan-12 5:44 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du7-Jan-12 6:48
Jun Du7-Jan-12 6:48 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
RobCroll8-Jan-12 18:13
RobCroll8-Jan-12 18:13 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du9-Jan-12 3:13
Jun Du9-Jan-12 3:13 
Basically, to meet the specific TDD requirement under discussion, I would create a sample unit test project that handles two initial cases:
1) Check the app.config file and see if the class being tested has been coded. In order to do that, you need to add a key to the config file and set it to false initially. Of course, some more intelligent alternative can be implemented if you feel like to.
2) As Ravi suggested in his message below, have each of the unfinished methods throw an "unimplemented" exception. Add a handler to the test code to capture this and fails aumatically.

After you have the above minimum test code in place, create a project template and an item template, called "TDDUnitTestPlroject" and "TDDUnitTest" respectively. From now on, you can use these templates for TDD unit test projects and you don't need to write the same code again and again.
Best,
Jun

AnswerRe: How to make auto-generated unit tests fail initially? Pin
Ravi Bhavnani9-Jan-12 2:12
professionalRavi Bhavnani9-Jan-12 2:12 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du9-Jan-12 3:22
Jun Du9-Jan-12 3:22 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Pete O'Hanlon9-Jan-12 3:52
mvePete O'Hanlon9-Jan-12 3:52 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Ravi Bhavnani9-Jan-12 4:18
professionalRavi Bhavnani9-Jan-12 4:18 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Pete O'Hanlon9-Jan-12 4:38
mvePete O'Hanlon9-Jan-12 4:38 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du9-Jan-12 8:12
Jun Du9-Jan-12 8:12 
AnswerRe: How to make auto-generated unit tests fail initially? Pin
BobJanova9-Jan-12 4:57
BobJanova9-Jan-12 4:57 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du9-Jan-12 5:15
Jun Du9-Jan-12 5:15 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Pete O'Hanlon9-Jan-12 5:29
mvePete O'Hanlon9-Jan-12 5:29 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
BobJanova9-Jan-12 6:48
BobJanova9-Jan-12 6:48 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
Jun Du9-Jan-12 7:45
Jun Du9-Jan-12 7:45 
GeneralRe: How to make auto-generated unit tests fail initially? Pin
BobJanova13-Jan-12 5:59
BobJanova13-Jan-12 5:59 
QuestionGZipStream appears to malfunction (24K maximum) Pin
Paladin20006-Jan-12 5:17
Paladin20006-Jan-12 5:17 
AnswerRe: GZipStream appears to malfunction (24K maximum) Pin
Luc Pattyn6-Jan-12 7:00
sitebuilderLuc Pattyn6-Jan-12 7:00 
GeneralRe: GZipStream appears to malfunction (24K maximum) Pin
Paladin20006-Jan-12 7:51
Paladin20006-Jan-12 7:51 
GeneralRe: GZipStream appears to malfunction (24K maximum) Pin
Paladin20006-Jan-12 9:02
Paladin20006-Jan-12 9:02 
GeneralRe: GZipStream appears to malfunction (24K maximum) Pin
jschell6-Jan-12 9:11
jschell6-Jan-12 9:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.