Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            var copyMachine = new CopyMachine();

            copyMachine.DepositMoney(8);
            copyMachine.SetStorageDevice(StorageDevice.flash);
            copyMachine.SetDocumentName("shpargalochka.txt");
            copyMachine.PrintDocument();
            copyMachine.DepositMoney(14);
            copyMachine.PrintDocument();
            copyMachine.SetDocumentName("kursach.docx");
            copyMachine.PrintDocument();
            copyMachine.GiveChange();
            //Exception here
            copyMachine.SetDocumentName("flash");
        }
Exemplo n.º 2
0
        public static void Main(string[] args)
        {
            var copyMachine = new CopyMachine();

            copyMachine.SelectDevice();
            copyMachine.DepositMoney();
            copyMachine.PrintDocument();
            copyMachine.SelectDevice();
            copyMachine.DepositMoney();
            copyMachine.SelectDocument();
            copyMachine.DepositMoney();
            copyMachine.PrintDocument();
            copyMachine.DepositMoney();
            copyMachine.PickUpMoney();
            copyMachine.DepositMoney();
            copyMachine.PickUpMoney();
        }