예제 #1
0
        static void Main(string[] args)
        {
            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);

            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());
            computer.ComputerState = State.Reparada;
            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();
        }
예제 #2
0
        public void AddComputerTest()
        {
            //Arrange
            Receptionist recepcionist = new Receptionist();
            Notebook     notebook     = new Notebook("Alan", Brand.Acer, true, false, OS.Windows, ComType.Notebook,
                                                     Processor.AMD, HardDisk.HDD1TB, RAM.GB16, "Se rompio", GraphicCard.MSIRadeonRX480);

            CoreProcedure.Computers = new List <Computer>();
            //Act
            recepcionist.AddComputer(notebook);

            //Assert
            Assert.IsTrue(CoreProcedure.ReceivedComputers.Count > 0);
        }
예제 #3
0
        public void ToRepairComputerTest()
        {
            //Arrange
            CoreProcedure procedure    = CoreProcedure.Instance;
            Receptionist  recepcionist = new Receptionist();
            Notebook      notebook     = new Notebook("Alan", Brand.HP, true, false, OS.Windows, ComType.Notebook,
                                                      Processor.Intel, HardDisk.SDD512GB, RAM.GB16, "Se rompio", GraphicCard.MSIRadeonRX480);

            CoreProcedure.Computers = new List <Computer>();

            //Act
            recepcionist.AddComputer(notebook);
            recepcionist.ToRepair(notebook);

            //Assert
            Assert.AreEqual(procedure[State.PorReparar].Count, 1);
        }
예제 #4
0
        public void UpdateComputerTest()
        {
            //Arrange
            Receptionist recepcionist = new Receptionist();
            Notebook     notebook     = new Notebook("Alan", Brand.AsRock, true, false, OS.Windows, ComType.Notebook,
                                                     Processor.AMD, HardDisk.SDD256GB, RAM.GB16, "Se rompio", GraphicCard.MSIRadeonRX480);
            Notebook notebook2 = new Notebook("Alan", Brand.Acer, true, false, OS.Linux, ComType.Notebook,
                                              Processor.Intel, HardDisk.HDD1TB, RAM.GB4, "Esta rota", GraphicCard.RadeonRX560);

            CoreProcedure.Computers = new List <Computer>();

            //Act
            recepcionist.AddComputer(notebook);
            recepcionist.UpdateComputer(notebook, notebook2);

            //Assert
            Assert.AreEqual(CoreProcedure.ReceivedComputers[0], notebook2);
        }
예제 #5
0
        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);
        }