Beispiel #1
0
        static void Main(string[] args)
        {
            CoreProcedure procedure    = CoreProcedure.Instance;
            Receptionist  recepcionist = new Receptionist("Alan", "Pucci", "recepcionista", "12345");
            Technician    technician   = new Technician("Alan", "Pucci", "recepcionista", "12345");
            Notebook      notebook     = new Notebook("Juancito", Brand.AsRock, false, true, OS.Windows, ComType.Notebook,
                                                      Processor.AMD, HardDisk.HDD1TB, RAM.GB4, "Pantalla azul", GraphicCard.MSIRadeonRX480);
            Notebook repairedNotebook = new Notebook("Juancito", Brand.ASUS, false, true, OS.Linux, ComType.Notebook,
                                                     Processor.AMD, HardDisk.HDD1TB, RAM.GB4, "Se reparó", GraphicCard.GigabyteRadeonRX550);

            recepcionist.AddComputer(notebook);
            Console.WriteLine("Se agrego la computadora\n");
            Computer computer = procedure[State.Recibida][0];

            Console.WriteLine(computer.Show());
            recepcionist.ToRepair(computer);
            computer = procedure[State.PorReparar][0];
            Console.WriteLine("\nSe envió al técnico\n");
            Console.WriteLine(computer.Show());
            technician.Repair(computer, repairedNotebook);
            computer = procedure[State.Reparada][0];
            Console.WriteLine("\nSe reparó la computadora\n");
            Console.WriteLine(computer.Show());
            technician.Deliver(computer);
            computer = procedure[State.PorEntregar][0];
            Console.WriteLine("\nSe envió al recepcionista\n");
            Console.WriteLine(computer.Show());
            recepcionist.ToDeliver(computer);
            computer = procedure[State.Devuelta][0];
            Console.WriteLine("\nSe devolvió al cliente\n");
            Console.WriteLine(computer.Show());
            Console.ReadKey();
        }
Beispiel #2
0
 static void Main(string[] args)
 {
     try
     {
         CoreProcedure procedure = CoreProcedure.Instance;
         CoreProcedure.Computers = new List <Computer>();
         Receptionist recepcionist = new Receptionist("Alan", "Pucci", "recepcionista", "12345");
         Technician   technician   = new Technician("Alan", "Pucci", "recepcionista", "12345");
         Notebook     notebook     = new Notebook(15, "Juancito", Brand.AsRock, false, true, OS.Windows, ComType.Notebook,
                                                  Processor.AMD, HardDisk.HDD1TB, RAM.GB4, "Pantalla azul", GraphicCard.MSIRadeonRX480, State.Recibida, DateTime.Now);
         Notebook repairedNotebook = new Notebook(15, "Juancito", Brand.AsRock, false, true, OS.Windows, ComType.Notebook,
                                                  Processor.AMD, HardDisk.SDD256GB, RAM.GB4, "Arreglada", GraphicCard.NvidiaGTX1050, State.Recibida, DateTime.Now);
         recepcionist.AddComputer(notebook);
         Console.WriteLine("Se agrego la computadora\n");
         Computer computer = procedure[State.Recibida][0];
         Console.WriteLine(computer.Show());
         recepcionist.ToRepair(computer);
         computer = procedure[State.PorReparar][0];
         Console.WriteLine("\nSe envió al técnico\n");
         Console.WriteLine(computer.Show());
         technician.Repair(computer, repairedNotebook);
         computer = procedure[State.Reparada][0];
         Console.WriteLine("\nSe reparó la computadora\n");
         Console.WriteLine(computer.Show());
         technician.Deliver(computer);
         computer = procedure[State.PorEntregar][0];
         Console.WriteLine("\nSe envió al recepcionista\n");
         Console.WriteLine(computer.Show());
         recepcionist.ToDeliver(computer);
         computer = procedure[State.Devuelta][0];
         Console.WriteLine("\nSe devolvió al cliente\n");
         Console.WriteLine(computer.Show());
         Console.ReadKey();
     }
     catch (Exception ex)
     {
         Console.WriteLine(ex);
         Console.ReadKey();
     }
 }
        public void RepairComputerTest()
        {
            //Arrange
            CoreProcedure procedure    = CoreProcedure.Instance;
            Receptionist  recepcionist = new Receptionist();
            Technician    technician   = new Technician();
            Notebook      notebook     = new Notebook("Alan", Brand.Acer, true, false, OS.Windows, ComType.Notebook,
                                                      Processor.AMD, HardDisk.HDD1TB, RAM.GB16, "Se rompio", GraphicCard.MSIRadeonRX480);
            Notebook notebook2 = new Notebook("Alan", Brand.Acer, true, false, OS.Linux, ComType.Notebook,
                                              Processor.AMD, HardDisk.HDD1TB, RAM.GB16, "Se arregló", GraphicCard.ASUSROGStrixRadeonRX580);

            notebook2.ComputerState = State.Reparada;
            CoreProcedure.Computers = new List <Computer>();

            //Act
            recepcionist.AddComputer(notebook);
            recepcionist.ToRepair(notebook);
            technician.Repair(notebook, notebook2);

            //Assert
            Assert.AreEqual(procedure[State.Reparada].Count, 1);
        }