I wrote a 220-line class with 5 public methods. I have a single test class that runs 28 tests of this class, which occupy more than 1200 lines of code, but this is mainly due to the repeated code used in setting up the tests. This code tests the DAL in my project to make sure that it interacts correctly with the database and that the stored procedures used are working correctly. Looks like I did a great job to test very small code. I use mocks with rhinos to avoid writing my own stubs where possible.
Is this typical unit testing?
, unit test LOC, . , .
, DAL . , , . /.
1200 , , . , ( , ..).
Edit:
, . Aggregate AggregateTests Edulinq. 15 3 , , .
Aggregate
AggregateTests
?
, unit test, , . unit test , "" , , , .
, DAL , .
unit test , . unit test - , wcf-web-api. , " ". YMMV
, .
, , , , , .
28 1200 43 . , , .
28 , .
You might want to try writing some tests that run directly with the database, and consider whether this is better. I find it more work to get the database setup, but then work less, since I don't need to fake the lower layers. Tests run slower, but they test things more fully. Of course, at the moment this is not really a unit test.