What is the best way to unit test a method that calls into multiple methods, for example:
modify(string value)
{
if(value.Length > 5) replaceit(value);
else changeit(value);
}
This pseudo code has a modify method that (currently) calls either replaceit() or changeit(). I have already wrote tests for replaceit and changeit, so writing a new test for modify will be 99% the same set of code. I need to test it thought because it may change in the future.
So do I copy paste the existing test code? Move the test code to a common function? Any other ideas? I'm not sure of the best practice here.