Exemple #1
0
        public void Device_Send_DeviceIsOff()
        {
            var device = new MultiFunctionalDevice("213456789");

            device.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                device.Send(doc1, "987654321");
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Print"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
Exemple #2
0
        public void Device_ScanAndSend_DeviceIsOff()
        {
            var device = new MultiFunctionalDevice("123456789");

            device.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                device.ScanAndSend("987654321");
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Print"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void Multifunctional_Fax_DeviceOff()
        {
            var multi = new MultiFunctionalDevice();

            multi.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                multi.Fax(out doc1);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Fax"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }