How do I test a method that draws something to the canvas. For example, for an android app, I have the following code:
@Override
public void draw(Canvas canvas) {
canvas.drawRect(rect, paint);
}
This of course is a very simple example, but still: how would I test that the correct Rect has been drawn? In other words, how to check if the UI is displaying the correct things.
I suppose I could check all my pixels on my screen to see if they have the right properties, but I guess that is a very naive approach :)