interface ISample
{
int Sum(int a,int b);
int Multiplication(int x,int a,int b);
}
class Sample
{
public int Sum(int a,int b)
{
return a+b;
}
public int Multiplication(int x,int a,int b)
{
return x*Sum(a,b);
}
}
I want to test the Multiplication method. But To test the method of Multiplication , sum method need to mocking. How do i mock Sum method ? Is it possible that something like this?
As other said you can use seperate interfaces . For Example
In your testing code: