Unit test, what do they really test?

Feb 11, 2015 at 7:22 AM
I am trying to figure out what the example unit test really do? To me it feels like it only tests the fakerepository?

For instance, it is possible to do a unit test of GetCustomerOrder?

I have a model where adding for instance a product will create an invoice, should that perhaps even be tests in the service layer instead of the repository? I am still trying to figure out the pattern.

Thanks in advance.
Feb 12, 2015 at 7:32 PM
Please review run the Integration Test https://genericunitofworkandrepositories.codeplex.com/SourceControl/latest#main/Sample/Northwind.Test/IntegrationTests/CustomerRepositoryTests.cs) which demonstrates and integration tests for both Repository and Service layers. How you go about implementing your unit or integration tests is a question that you and/or your team need to answer based on the user story you are implementing. From a TDD approach, your implementation should start with a test.
Marked as answer by lelong37 on 2/12/2015 at 11:32 AM
Feb 13, 2015 at 8:17 AM
I must have been unclear in my question. For instance here: https://genericunitofworkandrepositories.codeplex.com/SourceControl/latest#main/Sample/Northwind.Test/UnitTests/Repository/ProductRepositoryTest.cs
is a unittest. Does that test do anything but test the fakecontext?

Why should one unit test the repository at all? Since there should be no business logic here, the only logic is delete/insert/edit ?
May 12, 2015 at 6:17 PM
Marked as answer by lelong37 on 5/12/2015 at 10:17 AM