Click here to Skip to main content
15,890,123 members
Home / Discussions / C#
   

C#

 
AnswerRe: How do I unit test this? Pin
Luc Pattyn14-Feb-10 5:03
sitebuilderLuc Pattyn14-Feb-10 5:03 
GeneralRe: How do I unit test this? [modified] Pin
Keith Barrow14-Feb-10 5:54
professionalKeith Barrow14-Feb-10 5:54 
AnswerRe: How do I unit test this? Pin
Not Active14-Feb-10 4:57
mentorNot Active14-Feb-10 4:57 
AnswerRe: How do I unit test this? Pin
Luc Pattyn14-Feb-10 5:00
sitebuilderLuc Pattyn14-Feb-10 5:00 
GeneralRe: How do I unit test this? Pin
Member 448708315-Feb-10 6:50
Member 448708315-Feb-10 6:50 
GeneralRe: How do I unit test this? Pin
Luc Pattyn15-Feb-10 11:44
sitebuilderLuc Pattyn15-Feb-10 11:44 
AnswerRe: How do I unit test this? [modified] Pin
Jimmanuel14-Feb-10 11:34
Jimmanuel14-Feb-10 11:34 
GeneralRe: How do I unit test this? Pin
Member 448708315-Feb-10 6:48
Member 448708315-Feb-10 6:48 
Some interesting comments here.

I don't completely agree with what you are saying about only testing public members. Firstly a unit test is supposed to test a unit eg. a single method, and if you don't call private members directly then it's not really unit testing.

I also like to test things thouroughly which may include using things in a way that they weren't necessarily supposed to be used. Dead code is potentially a bug waiting to happen IMHO. Imagine the code is changed in the future and the dead code comes to life. People will think the dead code has been tested and will trust is, but in reality it has probably never been executed and may have bugs in it. Statistically there is a higher chance of finding bugs around redundant code so I would want to know about the dead code. If it wasn't needed I would delete it or at least comment it out.

I agree that it's not a good idea to change the accessiblity for testing, and I don't plan to do this. However, in the real world it may be worth making a few modifications for testing. In the past I have made a change that allowed me to change the database connection string for testing, and in my opinion, it didn't really reduce the quality of the code.
GeneralRe: How do I unit test this? Pin
Jimmanuel15-Feb-10 8:46
Jimmanuel15-Feb-10 8:46 
QuestionCrash inside InitializeComponent() Pin
SimpleData14-Feb-10 0:24
SimpleData14-Feb-10 0:24 
AnswerRe: Crash inside InitializeComponent() Pin
Abhinav S14-Feb-10 0:30
Abhinav S14-Feb-10 0:30 
GeneralRe: Crash inside InitializeComponent() Pin
SimpleData14-Feb-10 0:34
SimpleData14-Feb-10 0:34 
GeneralRe: Crash inside InitializeComponent() Pin
Abhinav S14-Feb-10 0:47
Abhinav S14-Feb-10 0:47 
GeneralRe: Crash inside InitializeComponent() Pin
SimpleData14-Feb-10 1:42
SimpleData14-Feb-10 1:42 
AnswerRe: Crash inside InitializeComponent() Pin
Luc Pattyn14-Feb-10 0:52
sitebuilderLuc Pattyn14-Feb-10 0:52 
GeneralRe: Crash inside InitializeComponent() Pin
SimpleData14-Feb-10 1:42
SimpleData14-Feb-10 1:42 
QuestionMy .net application stops suddenly , want to know why ? Pin
Dr.DigiTaL13-Feb-10 21:51
Dr.DigiTaL13-Feb-10 21:51 
AnswerRe: My .net application stops suddenly , want to know why ? Pin
Abhinav S13-Feb-10 22:13
Abhinav S13-Feb-10 22:13 
Questionconvert image Pin
reza kia13-Feb-10 20:41
professionalreza kia13-Feb-10 20:41 
AnswerRe: convert image Pin
dan!sh 13-Feb-10 20:51
professional dan!sh 13-Feb-10 20:51 
GeneralRe: convert image Pin
reza kia14-Feb-10 1:34
professionalreza kia14-Feb-10 1:34 
GeneralRe: convert image Pin
dan!sh 14-Feb-10 3:59
professional dan!sh 14-Feb-10 3:59 
GeneralRe: convert image Pin
reza kia14-Feb-10 21:06
professionalreza kia14-Feb-10 21:06 
QuestionHow to read an image from an .xml file can we insert an image in .xml file Pin
koganti.pardhasaradhi13-Feb-10 19:26
koganti.pardhasaradhi13-Feb-10 19:26 
AnswerRe: How to read an image from an .xml file can we insert an image in .xml file Pin
dan!sh 13-Feb-10 20:07
professional dan!sh 13-Feb-10 20:07 

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.