Why is there a lot of hatred about the 'partial joke' and the code required for it?
Here is a (theoretical) example implementation:
public premises result 1 action A (excitation a) {{... result = ...; } Auditchange (A); } Public area results 2 Operation B (inspiration b) {{... results = ...; } Auditchange (B); Return result; } Void auditTheChange {// change records record a bunch of stuff and interact with another outside service)
Now, I think it's good If there is an audit in each scenario, but if I want to unify a test operation A and Operation B, and , then Without the test the characteristics of the audit code, I come I'll use jokes fun.
What do I see / understand / understand which causes so many projects (Isil, Mokito etc.) to recommend refactoring?
If auditing is actually the internal function of the orbit, then the code should be checked as part of the unit test. . Why does your class handle complex operations and auditing? Can auditing be transferred to a different category?
If so, present auditing as a collaborator with this class and duplicate it. If not, then do the unit testing.
You can use partial mocks, but in this case I think it is an indication that the class is doing too much.
Comments
Post a Comment