I currently access my data through a repository. So in my service layer I could have a method as below (just an example):
public IEnumerable<Customer> GetCustomersByCountry(string country)
List<Customer> custList;
using(customerRepostory.Adapter = new DataAccessAdapter())
{
custList = customerRepostory.Find(c.Country==country).ToList();
}
return custList;
}
Say I needed to test this method I mock the repository. Then I need to also mock or stub out the dataaccessadapter. I am using moq. Anyone have any ideas what is the best way to do this?
Thanks