Пример #1
0
        public void Copier_ScanAndPrint_DeviceOn_ScannerOff_PrinterOff()
        {
            var copier = new Copier();

            copier.PowerOn();
            copier.CopierScannerOff();
            copier.CopierPrinterOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1;
                copier.Scan(out doc1);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Scan"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }