Unit testing composite functions

Viewed 968

Say you have 3 functions, functionA, functionB, and functionC

functionC relies on functionA and functionB

functionA(a) {
    return a
}
functionB(b) {
     return b
}
functionC(a, b){
     return functionA(a) + functionB(b);
}

Now this is obviously a super simplified example.. but what's the correct way to test functionC? If I'm already testing functionA and functionB and theyre passing wouldn't testing functionC wind up being more than a unit test since it would be relying on functionA and functionB returns..

3 Answers
Related