How to unit test a class that uses static API
Unit tests validate code in isolation, but if it uses statics you cannot mock this dependency, therefore a subject under test cannot be properly isolated and unit tested. This trick makes the code testable, as well as introduces an important principle that improves your architecture by making it cleaner and more flexible.
https://gamedev.center/how-to-unit-test-a-class-that-uses-static-api/
#testing #cleancode #architecture #testrunner
Post #1608
61