When unit testing functions of a class that has private functions that require online functionality. How would one go about testing it?
For example:
public class Foo
{
public int methodA()
{
int val = goOnlineToGetVal();
return val;
}
private int goOnlineToGetVal()
{
CloudService c = new CloudService();
int oval = c.getValueFromService();
return oval;
}
}
If I were to test function: 'methodA()' it would attempt to use 'goOnlineToGetVal()' which would in turn try to go online however, if this test was done without functionality. How would I go about 100% Class coverage without going online?