I have a JUCE
Component that needs to trigger another callback in another part of my code whenever it receives certain UI callbacks such as
I always write unit tests for the re-usable bits of my code. So in this case, in the unit test I would manually call the component’s
mouseDown and then check that the desired side effect occurred.
However I just can’t figure out how to do that! calling
mouseDown requires me to pass in a
MouseEvent, which I cannot instantiate without giving it a
MouseInputSource. And that
MouseInputSource is, as far as I can see, completely impossible to instantiate, obtain an instance of it from anywhere, inherit from, or anything else I can think of!
JUCE fiercely resists all my attempts to write a mocking framework for it to make its UI bits unit testable in any way…
In the meantime, does anyone has an idea how to unit test things like that?