public void Copier_GetState_StateOn()
        {
            var copier = new Copier();

            copier.PowerOn();

            Assert.AreEqual(IDevice.State.on, copier.GetState());
        }
Exemple #2
0
        public void MultidimensionalDevice_GetState_StateOn()
        {
            var copier = new Copier();

            copier.PowerOn();

            Assert.AreEqual(IDevice.State.on, copier.GetState());
        }
        public void Copier_GetState_StateOn()
        {
            var p      = new Printer();
            var s      = new Scanner();
            var copier = new Copier(p, s);

            copier.PowerOn();

            Assert.AreEqual(IDevice.State.on, copier.GetState());
        }
        static void Main(string[] args)
        {
            Copier copier = new Copier();

            Console.WriteLine($"Current copier state: {copier.GetState()}");
            copier.PowerOn();
            Console.WriteLine($"Current copier state: {copier.GetState()}");
            var doc = new PDFDocument("doc.pdf");

            copier._Printer.Print(doc);
            copier._Printer.Print(doc);
            copier._Printer.Print(doc);
            //cooling down after 3 prints
            copier._Printer.Print(doc);
            copier._Scanner.Scan();
            copier._Scanner.Scan();
            //cooling down after 2 scans
            copier._Scanner.Scan();
            copier.GetCounter();
            Console.WriteLine($"Current copier state: {copier.GetState()}");
            copier.PowerOff();
            Console.WriteLine($"Current copier state: {copier.GetState()}");
        }