I create my compact test database. This is a SDF file, embedded as a visual studio resource. When test suite starts this database is copied in
%LOCALAPPDATA% so my test can use it.
The first method that I want to test is the
getById method. Pretty simple.
var response = repo.GetById(IdToFind) Assert.IsNotNull(response);
Now suppose I want to test the
Remove method. These are the steps that I figure out:
repo.Remove(objectToRemove) var response = repo.GetById(objectToRemove.Id) // is this a right choice? Assert.IsNull(response);
this seems pretty clear to me, except for the GetById call. Does this step undermine test atomicity?