Unit Tests in .Net C#
Edit
I am thrill the project I am currently working is a full agile TDD project (well, I cheated I still write my code before my test) in .Net C#
I have been looking the best way to structure the unit test and found this nice article Structuring Unit Tests , basically it suggests to have a nested class structure (click into the link to know more, it is pretty straight forward). After trying to write test suite with that structure, I ran into the Setup and TearDown problem because of the special structure of the Test Class. Then I found another article that complement the first one which got a solution for the Setup and TearDown problem in the Nested Class Test Case structure.
The next thing that bother me is that I need mock object for my test, and I am struggling to find a nice mock object lib/framework that basically could help me to create a mock object when I pass it an interface. Is there any suggestion?
I have been looking the best way to structure the unit test and found this nice article Structuring Unit Tests , basically it suggests to have a nested class structure (click into the link to know more, it is pretty straight forward). After trying to write test suite with that structure, I ran into the Setup and TearDown problem because of the special structure of the Test Class. Then I found another article that complement the first one which got a solution for the Setup and TearDown problem in the Nested Class Test Case structure.
The next thing that bother me is that I need mock object for my test, and I am struggling to find a nice mock object lib/framework that basically could help me to create a mock object when I pass it an interface. Is there any suggestion?
Unit Tests in .Net C#
Reviewed by DF
on
7:33:00 AM
Rating: