public void Print_ShouldBecomeTargetControlAndUseIControlPrinterToPrint() { var pictureBox = new PictureBox(); var printer = Substitute.For <IControlPrinter <PictureBox> >(); pictureBox.Print(printer); Assert.That(printer.TargetControl, Is.EqualTo(pictureBox)); printer.Received().Print(); }
public static void Print(this PictureBox pictureBox) { pictureBox.Print(new PictureBoxPrinter(pictureBox)); }