How would you unit test the PerformUpdate method in the sample below? This is a (very) simplified version of some code that performs updates against a database where the schema is dynamic and represented by the fields collection.
EDIT: If it is not clear what I am asking, I would like to know how different developers would approach testing\mocking this code from a TDD perspective. For example, what tests would you write, what would you mock, how would you verify method calls are made with the right arguments?
public interface IUnitOfWork
{
IEfRepository<Field> Fields { get; }
}
public class UpdateService
{
private IUnitOfWork unitOfWork;
private IDataUpdater dataService;
public Activity PerformUpdate(App app, IDictionary<string, object> data)
{
var fields = this.unitOfWork.Fields.FindWhere(o => o.App.Identifier == app.Identifier);
var activity = this.dataService.PerformUpdate(fields, data);
return activity;
}
}