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();
        }
示例#2
0
 public static void Print(this PictureBox pictureBox)
 {
     pictureBox.Print(new PictureBoxPrinter(pictureBox));
 }