Is there a benefit in mocking a concrete class vs an interface?
sample:
In my CustomerService
class I call the CustomerDataProvider
like
customerDataProvider.GetCustomers();
customerDataProvider
could also be of type ICustomerDataProvider
. When I want to test the logic inside the CustomerService
only without going to the database then I have to mock the customerDataProvider
object of type ICustomerDataProvider
OR CustomerDataProvider
.
Where is the advantage in mocking one type over the other?