i have a sytem a that include system b and return the result. simple!.
concrete example an API, one controller that internally call another class then perform the operation.
route --> controller -----> class
I would do this a series of unit test for all piece the code then a series of functional test for the controller then a series of functional test for the class used in controller well!
my doubt is this for functional test of controller i test the behaviour a,b,c simil a black box input > controller > output.
but for functional test of the class used inner the controller i test the same behaviour a,b,c because the controller is a simple container that delegate a inner class.
in the end I will have the serie of functional test very very similar. from my point of view this is correct because for example the controller he could do the same things but do not use that inner class.
I try to explain better in pseudo code:
The architecture type is:
controller class mehtodCallFromAPI ... do someOtherThings.. call otherclass->doSomething();
Functional of test controller on API
1 - test if after call API respond Http status code 201 2 - test if after call API the db is change 3 - test if after call API the status of system is changed related businessLogic
Functional of test class inner controller on API
<strike>1 - test if after call API respond Http status code 201</strike> 2 - test if after call method class the db is change 3 - test if after call method class the status of system is changed related businessLogic
This is correct ?