Пример #1
0
        public void MultiFunctionalDevice_PowerOnCounter()
        {
            var fax = new MultifunctionalDevice();

            fax.PowerOn();
            fax.PowerOn();
            fax.PowerOn();

            IDocument doc1;

            fax.Scan(out doc1);
            IDocument doc2;

            fax.Scan(out doc2);

            fax.PowerOff();
            fax.PowerOff();
            fax.PowerOff();
            fax.PowerOn();

            IDocument doc3 = new ImageDocument("aaa.jpg");

            fax.Print(in doc3);

            fax.PowerOff();
            fax.Print(in doc3);
            fax.Scan(out doc1);
            fax.PowerOn();

            fax.ScanAndPrint();
            fax.ScanAndPrint();

            // 3 w³¹czenia
            Assert.AreEqual(3, fax.Counter);
        }
        public void MultifunctionalDevice_FaxCounter()
        {
            var multiFunDev = new MultifunctionalDevice();

            multiFunDev.PowerOn();

            IDocument doc1 = new PDFDocument("aaa.pdf");

            multiFunDev.Print(in doc1);
            IDocument doc2 = new TextDocument("aaa.txt");

            multiFunDev.Print(in doc2);

            multiFunDev.ScanAndSend(123456789);

            multiFunDev.PowerOff();
            multiFunDev.ScanAndSend(987654321);
            multiFunDev.Scan(out doc1);
            multiFunDev.PowerOn();
            multiFunDev.ScanAndSend(987654321);

            multiFunDev.ScanAndPrint();
            multiFunDev.ScanAndPrint();

            // 2 wys³ane faxy, gdy urz¹dzenie w³¹czone
            Assert.AreEqual(2, multiFunDev.FaxCounter);
        }
        public void MultifunctionalDevice_Scan_FormatTypeDocument()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter()) {
                IDocument doc1;
                copier.Scan(out doc1, formatType: IDocument.FormatType.JPG);
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsTrue(consoleOutput.GetOutput().Contains(".jpg"));

                copier.Scan(out doc1, formatType: IDocument.FormatType.TXT);
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsTrue(consoleOutput.GetOutput().Contains(".txt"));

                copier.Scan(out doc1, formatType: IDocument.FormatType.PDF);
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsTrue(consoleOutput.GetOutput().Contains(".pdf"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_PrintCounter()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();

            IDocument doc1 = new PDFDocument("aaa.pdf");

            copier.Print(in doc1);
            IDocument doc2 = new TextDocument("aaa.txt");

            copier.Print(in doc2);
            IDocument doc3 = new ImageDocument("aaa.jpg");

            copier.Print(in doc3);

            copier.PowerOff();
            copier.Print(in doc3);
            copier.Scan(out doc1);
            copier.PowerOn();

            copier.ScanAndPrint();
            copier.ScanAndPrint();

            // 5 wydruków, gdy urządzenie włączone
            Assert.AreEqual(5, copier.PrintCounter);
        }
Пример #5
0
        public void MFD_ScanCounter()
        {
            MultifunctionalDevice device = new MultifunctionalDevice();

            device.PowerOn();

            IDocument doc1;

            device.Scan(out doc1);
            IDocument doc2;

            device.Scan(out doc2);

            IDocument doc3 = new ImageDocument("aaa.jpg");

            device.Print(in doc3);

            device.PowerOff();
            device.Print(in doc3);
            device.Scan(out doc1);
            device.PowerOn();

            device.ScanAndPrint();
            device.ScanAndPrint();

            // 4 skany, gdy urz¹dzenie w³¹czone
            Assert.AreEqual(4, device.ScanCounter);
        }
        public void MultifunctionalDevice_ScanCounter()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();

            IDocument doc1;

            copier.Scan(out doc1);
            IDocument doc2;

            copier.Scan(out doc2);

            IDocument doc3 = new ImageDocument("aaa.jpg");

            copier.Print(in doc3);

            copier.PowerOff();
            copier.Print(in doc3);
            copier.Scan(out doc1);
            copier.PowerOn();

            copier.ScanAndPrint();
            copier.ScanAndPrint();

            // 4 skany, gdy urządzenie włączone
            Assert.AreEqual(4, copier.ScanCounter);
        }
Пример #7
0
        public void MFD_PowerOnCounter()
        {
            MultifunctionalDevice device = new MultifunctionalDevice();

            device.PowerOn();
            device.PowerOn();
            device.PowerOn();

            IDocument doc1;

            device.Scan(out doc1);
            IDocument doc2;

            device.Scan(out doc2);

            device.PowerOff();
            device.PowerOff();
            device.PowerOff();
            device.PowerOn();

            IDocument doc3 = new ImageDocument("aaa.jpg");

            device.Print(in doc3);

            device.PowerOff();
            device.Print(in doc3);
            device.Scan(out doc1);
            device.PowerOn();

            device.ScanAndPrint();
            device.ScanAndPrint();

            // 3 w³¹czenia
            Assert.AreEqual(3, device.Counter);
        }
Пример #8
0
        public void MFD_PrintCounter()
        {
            MultifunctionalDevice device = new MultifunctionalDevice();

            device.PowerOn();

            IDocument doc1 = new PDFDocument("aaa.pdf");

            device.Print(in doc1);
            IDocument doc2 = new TextDocument("aaa.txt");

            device.Print(in doc2);
            IDocument doc3 = new ImageDocument("aaa.jpg");

            device.Print(in doc3);

            device.PowerOff();
            device.Print(in doc3);
            device.Scan(out doc1);
            device.PowerOn();

            device.ScanAndPrint();
            device.ScanAndPrint();

            // 5 wydruków, gdy urz¹dzenie w³¹czone
            Assert.AreEqual(5, device.PrintCounter);
        }
        public void MultifunctionalDevice_FaxCounter()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();
            string    to   = "1234";
            IDocument doc1 = new PDFDocument("aaa.pdf");

            copier.SendFax(in doc1, to);
            IDocument doc2 = new TextDocument("aaa.txt");

            copier.SendFax(in doc2, to);
            IDocument doc3 = new ImageDocument("aaa.jpg");

            copier.SendFax(in doc3, to);

            copier.PowerOff();
            copier.SendFax(in doc3, to);
            copier.Scan(out doc1);
            copier.PowerOn();

            copier.ScanAndFax(to);
            copier.ScanAndFax(to);

            // 5 wydruków, gdy urządzenie włączone
            Assert.AreEqual(5, copier.FaxCounter);
        }
Пример #10
0
        public void MultifunctionalDevice_Trying_Not_To_Type_Reciever_Of_Fax(string reciever)
        {
            var fax = new MultifunctionalDevice();

            fax.PowerOn();
            fax.Fax(reciever);
        }
        public void MultifunctionalDevice_PowerOnCounter()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();
            copier.PowerOn();
            copier.PowerOn();

            IDocument doc1;

            copier.Scan(out doc1);
            IDocument doc2;

            copier.Scan(out doc2);

            copier.PowerOff();
            copier.PowerOff();
            copier.PowerOff();
            copier.PowerOn();

            IDocument doc3 = new ImageDocument("aaa.jpg");

            copier.Print(in doc3);

            copier.PowerOff();
            copier.Print(in doc3);
            copier.Scan(out doc1);
            copier.PowerOn();

            copier.ScanAndPrint();
            copier.ScanAndPrint();

            // 3 włączenia
            Assert.AreEqual(3, copier.Counter);
        }
Пример #12
0
        public void MultiFunctionalDevice_SentFaxCounter()
        {
            var multifunctionalDevice = new MultifunctionalDevice();

            multifunctionalDevice.PowerOn();

            IDocument doc1;

            multifunctionalDevice.SendFax(out doc1, 0700800800);
            IDocument doc2;

            multifunctionalDevice.SendFax(out doc2, 0700800800);
            IDocument doc3;

            multifunctionalDevice.SendFax(out doc3, 0700800800);

            multifunctionalDevice.PowerOff();
            multifunctionalDevice.SendFax(out doc3, 0700800800);
            multifunctionalDevice.PowerOn();

            multifunctionalDevice.ScanAndPrint();
            multifunctionalDevice.ScanAndPrint();

            Assert.AreEqual(3, multifunctionalDevice.SentFaxCounter);
        }
Пример #13
0
        public void MD_FaxCounter()
        {
            var d = new MultifunctionalDevice();

            d.PowerOn();

            IDocument doc1 = new PDFDocument("aaa.pdf");

            d.Fax(in doc1);
            IDocument doc2 = new TextDocument("aaa.txt");

            d.Fax(in doc2);
            IDocument doc3 = new ImageDocument("aaa.jpg");

            d.Fax(in doc3);

            d.PowerOff();
            d.Fax(in doc3);
            d.PowerOn();

            d.Fax(in doc1);
            d.Fax(in doc2);

            // 5 faksów, gdy urz¹dzenie w³¹czone
            Assert.AreEqual(5, d.FaxCounter);
        }
Пример #14
0
        public void MD_GetState_StateOn()
        {
            var d = new MultifunctionalDevice();

            d.PowerOn();

            Assert.AreEqual(IDevice.State.on, d.GetState());
        }
        public void MultifunctionalDevice_GetState_StateOn()
        {
            var multiFunDev = new MultifunctionalDevice();

            multiFunDev.PowerOn();

            Assert.AreEqual(IDevice.State.on, multiFunDev.GetState());
        }
Пример #16
0
        public void MFD_GetState_StateOn()
        {
            MultifunctionalDevice device = new MultifunctionalDevice();

            device.PowerOn();

            Assert.AreEqual(IDevice.State.on, device.GetState());
        }
Пример #17
0
        public void MultiFunctionalDevice_GetState_StateOn()
        {
            var fax = new MultifunctionalDevice();

            fax.PowerOn();

            Assert.AreEqual(IDevice.State.on, fax.GetState());
        }
        public void MultifunctionalDevice_GetState_StateOn()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();

            Assert.AreEqual(IDevice.State.on, copier.GetState());
        }
Пример #19
0
        public void MultifunctionalDevice_NotDoubling_Recievers_On_Recievers_List()
        {
            var fax = new MultifunctionalDevice();

            fax.PowerOn();
            fax.Fax("Test1");
            fax.Fax("Test1");
            fax.Fax("Test1");
            Assert.AreEqual(1, fax.RecieversList.Count);
        }
Пример #20
0
        public void MultifunctionalDevice_Correct_FaxCounter()
        {
            var fax = new MultifunctionalDevice();

            fax.PowerOn();
            fax.Fax("test1");
            fax.Fax("test1");
            fax.Fax("test1");
            fax.Fax("test1");
            fax.Fax("test1");
            Assert.AreEqual(5, fax.FaxCounter);
        }
Пример #21
0
        public void Fax_SendFax_DeviceOff()
        {
            var multifunctionalDevice = new MultifunctionalDevice();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1;
                multifunctionalDevice.SendFax(out doc1, 0700800800);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Sending"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
Пример #22
0
        public void Fax_ReceiveFax_DeviceOff()
        {
            var multifunctionalDevice = new MultifunctionalDevice();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                multifunctionalDevice.ReceiveFax(in doc1, 0800700700);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Received"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_Scan_DeviceOff()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOff();

            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);
        }
        public void MultifunctionalDevice_Print_DeviceOff()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter()) {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                copier.Print(in doc1);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Print"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_ScanAndPrint_DeviceOn()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOn();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter()) {
                copier.ScanAndPrint();
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Print"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_Print_DeviceOff()
        {
            var multiFunDev = new MultifunctionalDevice();

            multiFunDev.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                multiFunDev.ScanAndSend(123456789);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Send"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
Пример #27
0
        public void MultifunctionalDevice_ScanAndSendFax_DeviceOn()
        {
            var device = new MultifunctionalDevice();

            device.PowerOn();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                device.ScanAndSendFax("1234455566");
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Fax"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_ScanAndFax_DeviceOff()
        {
            var copier = new MultifunctionalDevice();

            copier.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter()) {
                string to = "1234";
                copier.ScanAndFax(to);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Scan"));
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Fax"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
Пример #29
0
        public void MD_Fax()
        {
            MultifunctionalDevice d = new MultifunctionalDevice();

            d.PowerOn();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter())
            {
                IDocument doc1 = new PDFDocument("document");
                d.Fax(in doc1);
                Assert.IsTrue(consoleOutput.GetOutput().Contains("Fax"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }
        public void MultifunctionalDevice_Fax_DeviceOff()
        {
            var multifunctionalDevice = new MultifunctionalDevice();

            multifunctionalDevice.PowerOff();

            var currentConsoleOut = Console.Out;

            currentConsoleOut.Flush();
            using (var consoleOutput = new ConsoleRedirectionToStringWriter()) {
                IDocument doc1 = new PDFDocument("aaa.pdf");
                string    to   = "1234";
                multifunctionalDevice.SendFax(in doc1, to);
                Assert.IsFalse(consoleOutput.GetOutput().Contains("Print"));
            }
            Assert.AreEqual(currentConsoleOut, Console.Out);
        }