I just had an argument with a colleague. I agree that private functions shouldn't be accessed directly in the unit test, let alone exposing them publicly for the sake of testing them. If you feel you really need to test a private method, chances are that that method shouldn't be part of your class and should live in a static class where you can actually test it separately.
I just had an argument with a colleague. I agree that private functions shouldn't be accessed directly in the unit test, let alone exposing them publicly for the sake of testing them. If you feel you really need to test a private method, chances are that that method shouldn't be part of your class and should live in a static class where you can actually test it separately.
I just had an argument with a colleague. I agree that private functions shouldn't be accessed directly in the unit test, let alone exposing them publicly for the sake of testing them.
If you feel you really need to test a private method, chances are that that method shouldn't be part of your class and should live in a static class where you can actually test it separately.
I'm disappointed, you didn't give a good example. In fact your example class has no private methods.🤣
As I said, I made the init method public, so I could test it as an example ;)
I just had an argument with a colleague. I agree that private functions shouldn't be accessed directly in the unit test, let alone exposing them publicly for the sake of testing them.
If you feel you really need to test a private method, chances are that that method shouldn't be part of your class and should live in a static class where you can actually test it separately.
I agree, nice point