Click here to Skip to main content
15,895,084 members
Home / Discussions / C#
   

C#

 
GeneralRe: i want to save a image form serialization.... Pin
maifs26-Sep-08 21:12
maifs26-Sep-08 21:12 
Questionhow to load Pdf file to file test to RichText Box Pin
wasimsharp26-Sep-08 1:02
wasimsharp26-Sep-08 1:02 
AnswerRe: how to load Pdf file to file test to RichText Box Pin
Simon P Stevens26-Sep-08 4:44
Simon P Stevens26-Sep-08 4:44 
AnswerRe: how to load Pdf file to file test to RichText Box Pin
John Ad26-Sep-08 7:40
John Ad26-Sep-08 7:40 
Questiontextbox control managing behaviour of editing content Pin
Witoldek26-Sep-08 0:59
Witoldek26-Sep-08 0:59 
AnswerRe: textbox control managing behaviour of editing content Pin
Anthony Mushrow26-Sep-08 1:22
professionalAnthony Mushrow26-Sep-08 1:22 
QuestionC# reflection? Pin
ppayal26-Sep-08 0:57
ppayal26-Sep-08 0:57 
AnswerRe: C# reflection? Pin
Simon P Stevens26-Sep-08 4:07
Simon P Stevens26-Sep-08 4:07 
I think you are missing the point of unit testing.

A unit test should run a piece of code and check that the output/result is as expected. A unit test does not examine code to check the semantics.

What you should do is write several unit tests that run the ExampleMethod with different parameters and checked the results were correct. You would also write several unit tests that run the ExampleMethod with invalid parameters and check that the method failed in the correct way.

What you are asking about doing is called "static analysis". MS have a tool called FxCop[^] which does static analysis. (Or if you have Vs2005/08 team versions, they have "code analysis" built in, which is basically the same as FxCop).

If you google there are several tutorials for writing your own custom rules for FxCop. (see here[^])

There are plenty of other static analysis tools[^] if you want to try a few out. There is also DevPartner[^] from Compuware, which I've used in the past and you can add custom rules to.

Simon

QuestionFileStream Pin
kk.tvm25-Sep-08 22:24
kk.tvm25-Sep-08 22:24 
AnswerRe: FileStream Pin
Programm3r25-Sep-08 22:34
Programm3r25-Sep-08 22:34 
GeneralRe: FileStream Pin
kk.tvm26-Sep-08 0:21
kk.tvm26-Sep-08 0:21 
Questionget current instance of visual studio IDE Pin
Vinod C S25-Sep-08 22:22
Vinod C S25-Sep-08 22:22 
QuestionChange registry key in Vista Pin
sarabjs25-Sep-08 22:06
sarabjs25-Sep-08 22:06 
AnswerRe: Change registry key in Vista Pin
Guffa25-Sep-08 22:15
Guffa25-Sep-08 22:15 
AnswerRe: Change registry key in Vista Pin
DaveyM6926-Sep-08 0:41
professionalDaveyM6926-Sep-08 0:41 
QuestionHelp Pls, How to get text from textbox or label on forms with winapi Pin
TALHAKOSEN25-Sep-08 22:04
TALHAKOSEN25-Sep-08 22:04 
AnswerRe: Help Pls, How to get text from textbox or label on forms with winapi Pin
Alan Balkany26-Sep-08 3:05
Alan Balkany26-Sep-08 3:05 
GeneralRe: Help Pls, How to get text from textbox or label on forms with winapi Pin
TALHAKOSEN26-Sep-08 3:08
TALHAKOSEN26-Sep-08 3:08 
QuestionHow to turn off UAC using c#? Pin
lovnin25-Sep-08 22:03
lovnin25-Sep-08 22:03 
AnswerRe: How to turn off UAC using c#? Pin
c242326-Sep-08 0:10
c242326-Sep-08 0:10 
AnswerRe: How to turn off UAC using c#? Pin
DaveyM6926-Sep-08 0:44
professionalDaveyM6926-Sep-08 0:44 
AnswerRe: How to turn off UAC using c#? Pin
Paul Conrad26-Sep-08 5:58
professionalPaul Conrad26-Sep-08 5:58 
QuestionOnline Media Player Pin
manishgkumar25-Sep-08 22:02
manishgkumar25-Sep-08 22:02 
AnswerRe: Online Media Player Pin
Ashfield26-Sep-08 1:22
Ashfield26-Sep-08 1:22 
QuestionDragDrop Multiple Items of the ListView Pin
Programm3r25-Sep-08 21:46
Programm3r25-Sep-08 21:46 

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.