public void Iniciar()
        {
            //Las Personas
            this.persona = FabricaEntidades.ObtenerPersona();
            this.persona.Id = 11;
            this.persona2 = FabricaEntidades.ObtenerPersona();
            this.persona2.Id = 12;
            this.persona3 = FabricaEntidades.ObtenerPersona();
            this.persona3.Id = 13;
            this.persona4 = FabricaEntidades.ObtenerPersona();
            this.persona4.Id = 14;

            //Implemento
            this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento.Id = 1;
            this.implemento.Precio_Implemento = 4500;

            //Eventos
            this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento();
            this.evento.Id = 1;
            this.evento.Costo = 0;

            //Matricula
            this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula();
            this.matricula.Id = 37;
            this.matricula.Costo = 4250;

            //Iniciamos los atributos para la prueba de vacio
            this.PruebaComandoVacio = FabricaComandos.CrearComandoVerCarrito();
            this.PruebaComandoVacio2 = FabricaComandos.CrearComandoVerCarrito(this.persona);
            this.pruebaComandoVacio3 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito();
            this.pruebaComandoVacio4 = (ComandoVerCarrito)FabricaComandos.CrearComandoVerCarrito(this.persona);

            //Carrito Cuando hay solo Implementos
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 5);
            this.ComandoAgregarItem.Ejecutar();
            this.PruebaVerSoloImplemento = FabricaComandos.CrearComandoVerCarrito(this.persona);

            //Carrito Cuando hay solo Eventos
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem
                (this.persona2, this.evento, 2, 6);
            this.ComandoAgregarItem.Ejecutar();
            this.PruebaVerSoloEvento = FabricaComandos.CrearComandoVerCarrito(this.persona2);

            //Carrito Cuando hay solo Matriculas
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 1);
            this.ComandoAgregarItem.Ejecutar();
            this.PruebaVerSoloMatricula = FabricaComandos.CrearComandoVerCarrito(this.persona3);

            //Carrito Cuando hay Implementos, Eventos y Matriculas
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.implemento, 1, 5);
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem
                (this.persona4, this.evento, 2, 6);
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.matricula, 3, 1);
            this.ComandoAgregarItem.Ejecutar();
            this.PruebaVerTodo = FabricaComandos.CrearComandoVerCarrito(this.persona4);
        }
        public void Iniciar()
        {
            //Dos implementos distintos
            this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento.Id = 1;
            this.implemento.Precio_Implemento = 4500;

            //La persona
            this.persona = FabricaEntidades.ObtenerPersona();
            this.persona.Id = 11;
            this.persona2 = FabricaEntidades.ObtenerPersona();
            this.persona2.Id = 12;
            this.persona3 = FabricaEntidades.ObtenerPersona();
            this.persona3.Id = 13;
            this.persona4 = FabricaEntidades.ObtenerPersona();
            this.persona4.Id = 14;
            this.persona5 = FabricaEntidades.ObtenerPersona();
            this.persona5.Id = 15;
            this.persona6 = FabricaEntidades.ObtenerPersona();
            this.persona6.Id = 16;

            //Iniciamos los atributos para la prueba de vacio
            this.datoPago = new List<String>();
            this.datoPago.Add("123456789");
            this.pago = FabricaEntidades.ObtenerPago(111,"Deposito", this.datoPago);
            this.PruebaComandoVacio = FabricaComandos.CrearComandoRegistrarPago();
            this.PruebaComandoVacio2 = FabricaComandos.CrearComandoRegistrarPago(this.persona, this.pago);
            this.pruebaComandoVacio3 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago();
            this.pruebaComandoVacio4 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago
                (this.persona, this.pago);

            //Implemento
            this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento.Id = 1;
            this.implemento.Precio_Implemento = 4500;

            //Eventos
            this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento();
            this.evento.Id = 1;
            this.evento.Costo = 0;

            //Matricula
            this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula();
            this.matricula.Id = 1;
            this.matricula.Costo = 5000;

            //Insertamos la cantidad de implementos que no pueden ser satisfechos por el stock
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona5, this.implemento, 1, 10);
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();

            //Insertamos una cantidad de inventario que no puede ser satisfecho de igual forma para esta persona
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona6, this.implemento, 1, 10);
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem.Ejecutar();

            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem
                (this.persona6, this.evento, 2, 10);
            this.ComandoAgregarItem.Ejecutar();
            this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona6, this.matricula, 3, 10);
            this.ComandoAgregarItem.Ejecutar();
        }
        public void Limpiar()
        {
            //Elimino de la persona5
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona5);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la persona6
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona6);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(3, this.evento, this.persona6);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona6);
            this.ComandoEliminar.Ejecutar();

            //Limpio los demas valores
            this.ComandoEliminar = null;
            this.persona = null;
            this.persona2 = null;
            this.persona3 = null;
            this.persona4 = null;
            this.persona5 = null;
            this.persona6 = null;
            this.matricula = null;
            this.implemento = null;
            this.evento = null;
            this.PruebaComandoVacio = null;
            this.PruebaComandoVacio2 = null;
            this.pruebaComandoVacio3 = null;
            this.pruebaComandoVacio4 = null;
            this.ComandoAgregarItem = null;
            this.ComandoRegistrarPago = null;
            this.pago = null;
            this.datoPago = null;
        }
        public void Iniciar()
        {
            //La persona
            this.persona = FabricaEntidades.ObtenerPersona();
            this.persona.Id = 11;
            this.persona2 = FabricaEntidades.ObtenerPersona();
            this.persona2.Id = 12;
            this.persona3 = FabricaEntidades.ObtenerPersona();
            this.persona3.Id = 13;
            this.persona4 = FabricaEntidades.ObtenerPersona();
            this.persona4.Id = 14;

            //Dos implementos distintos
            this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento.Id = 1;
            this.implemento.Precio_Implemento = 4500;
            this.implemento2 = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento2.Id = 5;
            this.implemento2.Precio_Implemento = 3000;

            //Eventos
            this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento();
            this.evento.Id = 1;
            this.evento.Costo = 0;

            this.evento2 = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento();
            this.evento2.Id = 2;
            this.evento2.Costo = 2000;

            //Dos matriculas distintas
            this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula();
            this.matricula.Id = 1;
            this.matricula.Costo = 5000;
            this.matricula2 = (Matricula)FabricaEntidades.ObtenerMatricula();
            this.matricula2.Id = 2;
            this.matricula2.Costo = 4500;

            //Iniciamos los atributos para la prueba de vacio
            this.PruebaComandoVacio = FabricaComandos.CrearComandoeliminarItem();
            this.PruebaComandoVacio2 = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona);
            this.pruebaComandoVacio3 = (ComandoeliminarItem)FabricaComandos.CrearComandoeliminarItem();
            this.pruebaComandoVacio4 = (ComandoeliminarItem)
                FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona);

            //valor  para Eliminar un Implemento
            this.pruebaComandoImplemento1 = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona);
            this.pruebaComandoImplemento2 =FabricaComandos.CrearComandoeliminarItem(1, this.implemento2, this.persona);

            //valor para Eliminar un Evento
            this.pruebaComandoEvento1 = FabricaComandos.CrearComandoeliminarItem(
                3, this.evento, this.persona2);
            this.pruebaComandoEvento2 = FabricaComandos.CrearComandoeliminarItem(
                3, this.evento2, this.persona2);

            //valor para Eliminar una Matricula
            this.pruebaComandoMatricula1 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona3);
            this.pruebaComandoMatricula2 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula2, this.persona3);

            //Comandos que eliminaran en la prueba de la persona4
            this.pruebaComandoImplemento3 =FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona4);
            this.pruebaComandoEvento3 = FabricaComandos.CrearComandoeliminarItem(3, this.evento, this.persona4);
            this.pruebaComandoMatricula3 = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona4);
        }
 public void Limpiar()
 {
     this.PruebaComandoVacio = null;
     this.PruebaComandoVacio2 = null;
     this.pruebaComandoVacio3 = null;
     this.pruebaComandoVacio4 = null;
     this.pruebaComandoImplemento1 = null;
     this.pruebaComandoImplemento2 = null;
     this.pruebaComandoImplemento3 = null;
     this.pruebaComandoAgregarImplemento = null;
     this.pruebaComandoEvento1 = null;
     this.pruebaComandoEvento2 = null;
     this.pruebaComandoEvento3 = null;
     this.pruebaComandoAgregarEvento = null;
     this.pruebaComandoMatricula1 = null;
     this.pruebaComandoMatricula2 = null;
     this.pruebaComandoMatricula3 = null;
     this.pruebaComandoAgregarMatricula = null;
     this.evento = null;
     this.evento2 = null;
     this.persona = null;
     this.persona2 = null;
     this.persona3 = null;
     this.persona4 = null;
     this.implemento = null;
     this.implemento2 = null;
     this.matricula = null;
     this.matricula2 = null;
 }
        public void Iniciar()
        {
            //Las personas
            this.persona = FabricaEntidades.ObtenerPersona();
            this.persona.Id = 11;
            this.persona2 = FabricaEntidades.ObtenerPersona();
            this.persona2.Id = 12;
            this.persona3 = FabricaEntidades.ObtenerPersona();
            this.persona3.Id = 13;

            //Implemento
            this.implemento = (Implemento)FabricaEntidades.ObtenerImplemento();
            this.implemento.Id = 1;
            this.implemento.Precio_Implemento = 4500;

            //Matricula
            this.matricula = (Matricula)FabricaEntidades.ObtenerMatricula();
            this.matricula.Id = 1;
            this.matricula.Costo = 5000;

            //Evento
            this.evento = (DominioSKD.Entidades.Modulo9.Evento)FabricaEntidades.ObtenerEvento();
            this.evento.Id = 1;
            this.evento.Costo = 0;

            //Iniciamos los atributos para la prueba de vacio
            this.PruebaComandoVacio = FabricaComandos.CrearComandoModificarCarrito();
            this.PruebaComandoVacio2 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona, this.implemento, 1, 30);
            this.pruebaComandoVacio3 = (ComandoModificarCarrito)FabricaComandos.CrearComandoModificarCarrito();
            this.pruebaComandoVacio4 = (ComandoModificarCarrito)FabricaComandos.CrearComandoModificarCarrito
                (this.persona, this.implemento, 1, 30);

            //Items que agregaremos para despues modificar
            this.PruebaSoloImplementos = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 20);
            this.PruebaSoloImplementos.Ejecutar();

            this.PruebaSoloEventos =
                FabricaComandos.CrearComandoAgregarItem(this.persona2, this.evento, 2, 10);
            this.PruebaSoloEventos.Ejecutar();

            this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.implemento, 1, 20);
            this.PruebaTodosItems.Ejecutar();
            this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem
                (this.persona3, this.evento, 2, 10);
            this.PruebaTodosItems.Ejecutar();
            this.PruebaTodosItems = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 1);
            this.PruebaTodosItems.Ejecutar();

            //ModificarCarrito del primer test
            this.ComandoModificarCarrito = FabricaComandos.CrearComandoModificarCarrito
                (this.persona, this.implemento, 1, 7);
            this.ComandoModificarCarrito2 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona2, this.evento, 2, 7);
            this.ComandoModificarCarrito3 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona3, this.implemento, 1, 7);
            this.ComandoModificarCarrito6 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona3, this.evento, 2, 7);

            //ModificarCarrito del segundo test
            this.ComandoModificarCarrito4 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona, this.implemento, 1, 8000);
            this.ComandoModificarCarrito5 = FabricaComandos.CrearComandoModificarCarrito
                (this.persona3, this.implemento, 1, 8000);
        }
        public void Limpiar()
        {
            //Elimino de la persona
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la persona2
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(3, this.implemento, this.persona2);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la persona3
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(2, this.implemento, this.persona3);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona3);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(3, this.implemento, this.persona3);
            this.ComandoEliminar.Ejecutar();

            //Dejo en null
            this.ComandoEliminar = null;
            this.persona = null;
            this.persona2 = null;
            this.persona3 = null;
            this.implemento = null;
            this.matricula = null;
            this.PruebaComandoVacio = null;
            this.PruebaComandoVacio2 = null;
            this.pruebaComandoVacio3 = null;
            this.pruebaComandoVacio4 = null;
            this.PruebaSoloImplementos = null;
            this.PruebaSoloEventos = null;
            this.PruebaTodosItems = null;
            this.ComandoModificarCarrito = null;
            this.ComandoModificarCarrito2 = null;
            this.ComandoModificarCarrito3 = null;
            this.ComandoModificarCarrito4 = null;
            this.ComandoModificarCarrito5 = null;
            this.ComandoModificarCarrito6 = null;
            this.evento = null;
        }
        public void PruebaCarritoVariosItems()
        {
            //Ejecutamos el comando y casteamos
            this.Carrito = (Carrito)this.PruebaVerTodo.Ejecutar();

            /*Revisamos que hayan Implementos, Eventos y matriculas, ademas,
              que efectivamente haya solo uno agregado de cada uno de ellos*/
            Assert.IsTrue(this.Carrito.ListaImplemento.Count == 1);
            Assert.IsTrue(this.Carrito.Listaevento.Count == 1);
            Assert.IsTrue(this.Carrito.Listamatricula.Count == 1);

            //Obtenemos los items y verificamos sus valores
            this.implemento = this.Carrito.ListaImplemento.ElementAt(0).Key as Implemento;
            Assert.AreEqual(this.implemento.Id, 1);
            Assert.AreEqual(this.implemento.Precio_Implemento, 4500);
            Assert.AreEqual(this.Carrito.ListaImplemento.ElementAt(0).Value, 5);

            this.evento = this.Carrito.Listaevento.ElementAt(0).Key as DominioSKD.Entidades.Modulo9.Evento;
            Assert.AreEqual(this.evento.Id, 1);
            Assert.AreEqual(this.evento.Costo, 0);
            Assert.AreEqual(this.Carrito.Listaevento.ElementAt(0).Value, 6);

            this.matricula = this.Carrito.Listamatricula.ElementAt(0).Key as Matricula;
            Assert.AreEqual(this.matricula.Id, 37);
            Assert.AreEqual(this.matricula.Costo, 4250);
            Assert.AreEqual(this.Carrito.Listamatricula.ElementAt(0).Value, 1);
        }
        public void PruebaCarritoSoloEventos()
        {
            //Ejecutamos el comando y casteamos
            this.Carrito = (Carrito)this.PruebaVerSoloEvento.Ejecutar();

            //Revisamos que solo hayan Eventos y efectivamente haya solo uno agregado
            Assert.IsTrue(this.Carrito.ListaImplemento.Count == 0);
            Assert.IsTrue(this.Carrito.Listaevento.Count == 1);
            Assert.IsTrue(this.Carrito.Listamatricula.Count == 0);

            //Obtenemos el Evento y verificamos sus valores
            this.evento = this.Carrito.Listaevento.ElementAt(0).Key as DominioSKD.Entidades.Modulo9.Evento;
            Assert.AreEqual(this.evento.Id, 1);
            Assert.AreEqual(this.evento.Costo, 0);
            Assert.AreEqual(this.Carrito.Listaevento.ElementAt(0).Value, 6);
        }
        public void Limpiar()
        {
            //Elimino de la primera prueba
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la segunda prueba
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem
                (3, this.evento, this.persona2);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la tercera prueba
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona3);
            this.ComandoEliminar.Ejecutar();

            //Elimino de la cuarta prueba
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(1, this.implemento, this.persona4);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem
                (3, this.evento, this.persona4);
            this.ComandoEliminar.Ejecutar();
            this.ComandoEliminar = FabricaComandos.CrearComandoeliminarItem(2, this.matricula, this.persona4);
            this.ComandoEliminar.Ejecutar();

            //Dejo en null
            this.ComandoEliminar = null;
            this.PruebaComandoVacio = null;
            this.PruebaComandoVacio2 = null;
            this.PruebaVerSoloImplemento = null;
            this.PruebaVerSoloEvento = null;
            this.PruebaVerSoloMatricula = null;
            this.PruebaVerTodo = null;
            this.pruebaComandoVacio3 = null;
            this.pruebaComandoVacio4 = null;
            this.ComandoAgregarItem = null;
            this.persona = null;
            this.persona2 = null;
            this.persona3 = null;
            this.persona4 = null;
            this.implemento = null;
            this.matricula = null;
            this.Carrito = null;
            this.evento = null;
        }