I have my unit tests. Each test method tests a logical UNIT of functionality in my system. In my unit tests external dependencies (db, file etc) are dealt with by using Mocks and Fakes.
Now iam not 100% sure how i should approach the integration test. Should i repeat the unit tests and replace then with the actual resources (DB, Files etc) or should i be testing for more lower level things such as:
1) Can ping Database
2) Can retrieve one record
3) Does File exist
etc...
My gut feel is that i should avoid biz logic in this phase as most of it should've been done in Unit, right?
Thanks
EDIT: I was a bit lazy in composing my question, what i also wanted to know was, if i needed to test biz logic in my integration phase then how should i set up my test suites so to minimize test code repeition. Take for example:
[TestMethod] //Unit Tests
public void CanGetData()
{
IRepository rep = new MockRepository();
var result = rep.GetData();
Assert.IsTrue(result != null)
}
[TestMethod] //Integration Test
public void CanGetData()
{
IRepository rep = new Repository(); //real repository
var result = rep.GetData();
Assert.IsTrue(result != null)
}
What test structure works for you? Do you use the Unit test assembly directly in your integration project and inject in the correct resources?