I need to mock just Method1 to test my process exception. How I can do that?
public interface IFoo
{
void Method1();
object Method2();
}
public class Foo : IFoo
{
public void Method1()
{
// Do something
}
public object Method2()
{
try
{
// Do something
Method1();
// Do somenthing
return new object();
}
catch (Exception ex)
{
// Process ex
return null;
}
}
}