How to unit test drawing graphics?
<p>My application (C#, WinForms) is a graphic editor, so drawing is a major part of functionality. I am having difficulties unit testing logic around drawing, which makes me think that my design is wrong. Let me describe it and I'd like some advice on either how to unit test or how to refactor my app's logic.</p>

<p>All drawing is handled by a manager (DrawingManager) which does geometric calculations and interacts with drawing canvases of controls that display the result. A typical method of this manager would be invoked with a reference to a drawing canvas (Graphics). Somewhere in the app's surface events (like OnPaint) we give control to the manager which decides what to draw and how, and then draws. To draw, it needs to hold a reference to the Graphics object, which is why it is passed to the manager's method from the event. </p>

<pre><code>    protected override void OnPaint(PaintEventArgs e)
    {            
        IZoomBoxDrawingManager drawingManager = ServiceLocator.Instance.Resolve&lt;IZoomBoxDrawingManager&gt;();
        drawingManager.DrawMainImage(this, e.Graphics);
        drawingManager.DrawObjects(this, e.Graphics);

        base.OnPaint(e);
    }
</code></pre>

<p>Now, let's say, DrawObjects invokes either one path of logic or the other before it starts calling Graphics' methods to output the geometry. 
I would like to somehow unit test the logic within this manager, but its coupling with Graphics instances makes it somehow impossible, at least I don't know how to do it. Moq which I use for isolating can't mock a sealed class. It would be sweet if I could put in some kind of registrator instead of Graphics and be able to see what methods of Graphics are invoked and when.
Please advise!</p>