public void Init() { implemento = new Implemento(); implemento2 = new Implemento(); implemento3 = new Implemento(); dojo = new Dojo(1); implemento.Nombre_Implemento = "Guantes Karate-DO"; implemento.Tipo_Implemento = "Guantes"; implemento.Marca_Implemento = "Adidas"; implemento.Color_Implemento = "Azul"; implemento.Talla_Implemento = "S"; implemento.Estatus_Implemento = "Activo"; implemento.Precio_Implemento = 1500; implemento.Stock_Minimo_Implemento = 5; implemento.Cantida_implemento = 20; implemento.Dojo_Implemento = dojo; implemento.Descripcion_Implemento = "Guantes Wola"; implemento.Imagen_implemento = "A.jpg"; implemento3.Nombre_Implemento = "Karategi Karate-DO"; implemento3.Tipo_Implemento = "Karategi"; implemento3.Marca_Implemento = "Kombate"; implemento3.Color_Implemento = "Verde"; implemento3.Talla_Implemento = "M"; implemento3.Estatus_Implemento = "Activo"; implemento3.Precio_Implemento = 1200; implemento3.Stock_Minimo_Implemento = 4; implemento3.Cantida_implemento = 10; implemento3.Dojo_Implemento = dojo; implemento3.Descripcion_Implemento = "Karategi Wololo"; implemento3.Imagen_implemento = "B.jpg"; }
public void sqlAgregarImplementoTest() { try { Int16 id = 1; Int16 idP = 1; Int16 prioridad = 1; String tipo = "Tratamiento de prueba"; Int16 cantidad = 2; List <Producto> lista = null; bool ImplementoAgregado = false; Implemento miImplemento = new Implemento(id, idP, prioridad, tipo, cantidad, lista); DAOImplemento serverImplemento = new DAOImplemento(); ImplementoAgregado = serverImplemento.SqlAgregarImplemento(miImplemento); //Assert que comprueba que el objeto exista. Assert.IsNotNull(miImplemento); //Assert para que los string no esten vacios Assert.IsNotEmpty(miImplemento.TipoProducto); Assert.IsTrue(ImplementoAgregado); } catch (NullReferenceException e) { throw new Exception("no hay objeto", e); } }
public void Init() { cai = new ComandoAgregarImplemento(); cei = new ComandoEliminarImplemento(); ccti = new ComandoConsultarTodosImplementos(); ccti2 = new ComandoConsultarTodosImplementos2(); cmi = new ComandoModificarImplemento(); cdi = new ComandoDojoId(); implemento = new Implemento(); implemento2 = new Implemento(); dojo = new Dojo(1); implemento.Nombre_Implemento = "Guantes Karate-DO"; implemento.Tipo_Implemento = "Guantes"; implemento.Marca_Implemento = "Adidas"; implemento.Color_Implemento = "Azul"; implemento.Talla_Implemento = "S"; implemento.Estatus_Implemento = "Activo"; implemento.Precio_Implemento = 1500; implemento.Stock_Minimo_Implemento = 5; implemento.Cantida_implemento = 20; implemento.Dojo_Implemento = dojo; implemento.Descripcion_Implemento = "Guantes Wola"; implemento.Imagen_implemento = "A.jpg"; cai.LaEntidad = implemento; cei.LaEntidad = implemento; cei.Dojo = dojo; ccti.LaEntidad = dojo; ccti2.LaEntidad = dojo; cmi.LaEntidad = implemento; }
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 SqlConsultarDetalleImplementoTest() { Int16 id1 = 1; DAOImplemento serverImplemento = new DAOImplemento(); Implemento miImplemento = serverImplemento.SqlConsultarDetalleImplemento(id1); //Assert que comprueba que el objeto exista. Assert.IsNotNull(miImplemento); }
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 = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Matricula this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //Evento this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //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.listaEventos[0], 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.listaEventos[0], 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.listaEventos[0], 2, 7); this.ComandoModificarCarrito3 = FabricaComandos.CrearComandoModificarCarrito(this.persona3, this.implemento, 1, 7); this.ComandoModificarCarrito6 = FabricaComandos.CrearComandoModificarCarrito(this.persona3, this.listaEventos[0], 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 Iniciar() { //Las Personas this.persona = FabricaEntidades.ObtenerPersona(); this.persona.Id = 20; this.persona2 = FabricaEntidades.ObtenerPersona(); this.persona2.Id = 21; this.persona3 = FabricaEntidades.ObtenerPersona(); this.persona3.Id = 22; this.persona4 = FabricaEntidades.ObtenerPersona(); this.persona4.Id = 23; //Implemento this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Eventos this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Matricula this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //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.listaEventos[0], 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.listaEventos[0], 2, 6); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.matricula, 3, 1); this.ComandoAgregarItem.Ejecutar(); this.PruebaVerTodo = FabricaComandos.CrearComandoVerCarrito(this.persona4); }
//NO #region Consultar Detalle Implemento public Implemento SqlConsultarDetalleImplemento(int _idimplemento) { SqlDataReader reader = null; Implemento miImplemento = new Implemento(); try { //Se abre la conexion a la base de datos _conexion.AbrirConexion(); command.Connection = _conexion.ObjetoConexion(); command.CommandType = System.Data.CommandType.StoredProcedure; command.CommandText = "[dbo].[mostrarImplemento]"; command.CommandTimeout = 10; command.Parameters.AddWithValue("@IdImplemento", _idimplemento); //se ejecuta el metodo del store procedure que busca todos los proyectos del sistema reader = command.ExecuteReader(); //Se recorre cada row while (reader.Read()) { //Se asigna cada atributo al objeto implemento //miImplemento.Id = Convert.ToInt16(reader.GetDecimal(0)); //miImplemento.Id = Convert.ToInt16(reader.GetDecimal(0)); //miImplemento.Nombre = reader.GetString(2); //miImplemento.Duracion = Convert.ToInt16(reader.GetDecimal(3)); //miImplemento.Descripcion = reader.GetString(4); //miImplemento.Costo = Convert.ToInt16(reader.GetDecimal(5)); //miImplemento.Imagen = reader.GetString(6); //miImplemento.Explicacion = reader.GetString(7); //se inserta el cliente en la lista de proyectos } return(miImplemento); } catch (SqlException e) { throw new ExcepcionImplemento("Error en la conexion", e); } catch (NullReferenceException e) { throw new ExcepcionImplemento("Los valores que devuelven la consulta son null", e); } //se cierra la conexion independientemente de que se haya detectado o no una excepcion. finally { _conexion.CerrarConexion(); } }
//listo protected void AgregarProducto_Click(object sender, EventArgs e) { try { if (ProductoSAsociado.SelectedIndex != -1) { error.Text = ""; _Implemento = _ImplementoSAsociado[ProductoSAsociado.SelectedIndex]; //guardo el objeto seleccionado _ImplementoAsociado.Add(_Implemento); //agrego el objeto a la lista sin asociar _ImplementoSAsociado.Remove(_Implemento); //quito el objeto de la lista de los asociados //_Implemento = new Implemento(0, producto.Id, Convert.ToInt16(Prioridad.SelectedIndex + 1),producto.Nombre, Convert.ToInt16(Cantidad.Text), null); //_ImplementoAsociado.Add(_Implemento); ProductoAsociado.Items.Add(ProductoSAsociado.SelectedItem.Text); //agrego el nombre del tratamiento de la otra lista ProductoSAsociado.Items.Remove(ProductoSAsociado.SelectedItem); //quito el tratamiento de la lista _Implemento = null; //limpio el objeto auxiliar de tratamiento MostrarDiv(); } else { error.Text = "Debe seleccionar un item de la lista Sin Asociar"; } } catch (ExcepcionTratamiento ex) { error.Text = ex.Message; } catch (NullReferenceException ex) { error.Text = ex.Message; } catch (IndexOutOfRangeException ex) { error.Text = ex.Message; } catch (Exception ex) { error.Text = ex.Message; } }
public void ConstructorImplementoPrueba() { Int16 idTratamiento = 1; Int16 idProducto = 1; Int16 prioridad = 2; String tipoProducto = "PruebaImplemento"; Int16 cantidad = 3; Implemento miImplemento = new Implemento(idTratamiento, idProducto, prioridad, tipoProducto, cantidad, null); String tipoProductoEsperado = "PruebaImplemento"; Assert.IsNotNull(miImplemento); //probando gets Assert.AreEqual(miImplemento.IdTratamiento, 1); Assert.AreEqual(miImplemento.IdProducto, 1); Assert.AreEqual(miImplemento.Prioridad, 2); Assert.AreEqual(miImplemento.Cantidad, 3); Assert.IsNotNullOrEmpty(miImplemento.TipoProducto); Assert.LessOrEqual(tipoProductoEsperado, miImplemento.TipoProducto); // miImplemento.IdTratamiento = 10; miImplemento.IdProducto = 10; miImplemento.Prioridad = 20; miImplemento.TipoProducto = "PruebaImplemento2"; miImplemento.Cantidad = 30; tipoProductoEsperado = "PruebaImplemento2"; Assert.AreEqual(miImplemento.IdTratamiento, 10); Assert.AreEqual(miImplemento.IdProducto, 10); Assert.AreEqual(miImplemento.Prioridad, 20); Assert.AreEqual(miImplemento.Cantidad, 30); Assert.IsNotNullOrEmpty(miImplemento.TipoProducto); Assert.LessOrEqual(tipoProductoEsperado, miImplemento.TipoProducto); }
public void Iniciar() { //Obtengo el DAO this.daoPrueba = FabricaDAOSqlServer.ObtenerdaoCarrito(); //La persona this.persona = new Persona(); this.persona.Id = 11; this.persona2 = new Persona(); this.persona2.Id = 12; this.persona3 = new Persona(); this.persona3.Id = 13; this.persona4 = new Persona(); this.persona4.Id = 14; this.persona5 = new Persona(); this.persona5.Id = 15; this.persona6 = new Persona(); this.persona6.Id = 16; //Dos implementos distintos this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; this.implemento2 = new Implemento(); this.implemento2.Id = 2; this.implemento2.Precio_Implemento = 3000; //Eventos this.listaEventos = FabricaComandos.CrearComandoConsultarTodosEventos().Ejecutar(); //Dos matriculas distintas this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; this.matricula2 = new Matricula(); this.matricula2.Id = 2; this.matricula2.Costo = 4500; }
public void PruebaCarritoVariosItems() { //Agregamos todos los items en el carrito de una persona this.daoPrueba.agregarItem(this.persona4, this.implemento, 1, 5); this.daoPrueba.agregarItem(this.persona4, this.listaEventos[0], 2, 6); this.daoPrueba.agregarItem(this.persona4, this.matricula, 3, 1); //Ejecutamos los metodos correspondientes para ver los items this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona4); this.EventosCarrito = this.daoPrueba.getEvento(this.persona4); this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona4); /*Revisamos que hayan Implementos, Eventos y matriculas, ademas, que efectivamente haya solo uno agregado de cada uno de ellos*/ Assert.IsTrue(this.ImplementosCarrito.Count == 1); Assert.IsTrue(this.EventosCarrito.Count == 1); Assert.IsTrue(this.MatriculasCarrito.Count == 1); //Obtenemos los items y verificamos sus valores this.implemento = this.ImplementosCarrito.ElementAt(0).Key as Implemento; Assert.AreEqual(this.implemento.Id_Implemento, 1); Assert.AreEqual(this.implemento.Precio_Implemento, 4500); Assert.AreEqual(this.ImplementosCarrito.ElementAt(0).Value, 5); this.evento = this.EventosCarrito.ElementAt(0).Key as Evento; Assert.AreEqual(this.evento.Id_evento, 1); Assert.AreEqual(this.evento.Costo, 0); Assert.AreEqual(this.EventosCarrito.ElementAt(0).Value, 6); this.matricula = this.MatriculasCarrito.ElementAt(0).Key as Matricula; Assert.AreEqual(this.matricula.Id, 1); //Assert.AreEqual(this.matricula.Costo, 5000); //PILAS CON EL COSTO ARREGLAR Assert.AreEqual(this.MatriculasCarrito.ElementAt(0).Value, 1); }
public void Limpiar() { this.persona = null; this.persona2 = null; this.persona3 = null; this.implemento = null; this.matricula = null; this.listaEventos = null; this.PruebaComandoVacio = null; this.PruebaComandoVacio2 = null; this.pruebaComandoVacio3 = null; this.pruebaComandoVacio4 = null; this.PruebaSoloImplementos = null; this.PruebaSoloEventos = null; this.PruebaTodosItems = null; this.eventos = null; this.ComandoModificarCarrito = null; this.ComandoModificarCarrito2 = null; this.ComandoModificarCarrito3 = null; this.ComandoModificarCarrito4 = null; this.ComandoModificarCarrito5 = null; }
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 PruebaCarritoSoloImplementos() { //Agregamos implementos en el carrito de la persona this.daoPrueba.agregarItem(this.persona, this.implemento, 1, 5); //Ejecutamos los metodos correspondientes para ver los items this.ImplementosCarrito = this.daoPrueba.getImplemento(this.persona); this.EventosCarrito = this.daoPrueba.getEvento(this.persona); this.MatriculasCarrito = this.daoPrueba.getMatricula(this.persona); //Revisamos que solo hayan Implementos y efectivamente haya solo uno agregado Assert.IsTrue(this.ImplementosCarrito.Count == 1); Assert.IsTrue(this.EventosCarrito.Count == 0); Assert.IsTrue(this.MatriculasCarrito.Count == 0); //Obtenemos el implemento y verificamos sus valores this.implemento = this.ImplementosCarrito.ElementAt(0).Key as Implemento; Assert.AreEqual(this.implemento.Id_Implemento, 1); Assert.AreEqual(this.implemento.Precio_Implemento, 4500); Assert.AreEqual(this.ImplementosCarrito.ElementAt(0).Value, 5); }
public void Limpiar() { 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.listaEventos = null; this.eventos = null; this.matricula = null; this.Carrito = null; this.evento = null; }
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 = new Persona(); this.persona.Id = 11; this.persona2 = new Persona(); this.persona2.Id = 12; this.persona3 = new Persona(); this.persona3.Id = 13; //Dos implementos distintos this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; this.implemento2 = new Implemento(); this.implemento2.Id = 2; this.implemento2.Precio_Implemento = 3000; //Eventos this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Dos matriculas distintas this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; this.matricula2 = new Matricula(); this.matricula2.Id = 2; this.matricula2.Costo = 4500; //Iniciamos los atributos para la prueba de vacio this.PruebaComandoVacio = FabricaComandos.CrearComandoAgregarItem(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 10); this.pruebaComandoVacio3 = (ComandoAgregarItem)FabricaComandos.CrearComandoAgregarItem(); this.pruebaComandoVacio4 = (ComandoAgregarItem)FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 10); //Diferentes valores para Agregar un Implemento this.pruebaComandoImplemento1 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 10); this.pruebaComandoImplemento2 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento, 1, 11); this.pruebaComandoImplemento3 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.implemento2, 1, 30); this.pruebaComandoImplemento4 = FabricaComandos.CrearComandoAgregarItem (this.persona, this.listaEventos[0], 2, 20); //Diferentes valores para Agregar un Evento this.pruebaComandoEvento1 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[0], 2, 10); this.pruebaComandoEvento2 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[0], 2, 11); this.pruebaComandoEvento3 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[1], 2, 30); this.pruebaComandoEvento4 = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.matricula, 3, 20); //Diferentes valores para Agregar una Matricula this.pruebaComandoMatricula1 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3, 10); this.pruebaComandoMatricula2 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3 , 11); this.pruebaComandoMatricula3 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.matricula, 3, 30); this.pruebaComandoMatricula4 = FabricaComandos.CrearComandoAgregarItem (this.persona3, this.implemento, 1, 20); }
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 Iniciar() { //Dos implementos distintos this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Iniciamos los atributos para la prueba de vacio this.persona = FabricaEntidades.ObtenerPersona(); this.PruebaComandoVacio = FabricaComandos.CrearComandoRegistrarPago(); this.PruebaComandoVacio2 = FabricaComandos.CrearComandoRegistrarPago(this.persona,"prueba"); this.pruebaComandoVacio3 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago(); this.pruebaComandoVacio4 = (ComandoRegistrarPago)FabricaComandos.CrearComandoRegistrarPago (this.persona, "prueba"); //Iniciamos los atributos para la prueba de RegistrarPago //La persona 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; //Implemento this.implemento = new Implemento(); this.implemento.Id = 1; this.implemento.Precio_Implemento = 4500; //Eventos this.eventos = FabricaComandos.CrearComandoConsultarTodosEventos(); this.listaEventos = this.eventos.Ejecutar(); //Matricula this.matricula = new Matricula(); this.matricula.Id = 1; this.matricula.Costo = 5000; //Agregamos datos ficticios en carritos this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona, this.implemento, 1, 20); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem (this.persona2, this.listaEventos[0], 2, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona3, this.matricula, 3, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.implemento, 1, 20); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem (this.persona4, this.listaEventos[0], 2, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona4, this.matricula, 3, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoRegistrarPago = FabricaComandos.CrearComandoRegistrarPago(this.persona,"Tarjeta"); this.ComandoRegistrarPago2 = FabricaComandos.CrearComandoRegistrarPago(this.persona2,"Deposito"); this.ComandoRegistrarPago3 = FabricaComandos.CrearComandoRegistrarPago(this.persona3, "Transferencia"); this.ComandoRegistrarPago4 = FabricaComandos.CrearComandoRegistrarPago(this.persona4, "Tarjeta"); //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 igualforma par aesta 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.listaEventos[0], 2, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoAgregarItem = FabricaComandos.CrearComandoAgregarItem(this.persona6, this.matricula, 3, 10); this.ComandoAgregarItem.Ejecutar(); this.ComandoRegistrarPago5 = FabricaComandos.CrearComandoRegistrarPago(this.persona5, "Tarjeta"); this.ComandoRegistrarPago6 = FabricaComandos.CrearComandoRegistrarPago(this.persona6, "Deposito"); }
public void Limpiar() { this.daoPrueba = null; this.persona = null; this.persona2 = null; this.persona3 = null; this.persona4 = null; this.persona5 = null; this.persona6 = null; this.implemento = null; this.implemento2 = null; this.listaEventos = null; this.matricula = null; this.matricula2 = null; this.ImplementosCarrito = null; this.EventosCarrito = null; this.MatriculasCarrito = null; this.evento = null; }
public void PruebaCarritoSoloImplementos() { //Ejecutamos el comando y casteamos this.Carrito = (Carrito)this.PruebaVerSoloImplemento.Ejecutar(); //Revisamos que solo hayan Implementos y efectivamente haya solo uno agregado Assert.IsTrue(this.Carrito.ListaImplemento.Count == 1); Assert.IsTrue(this.Carrito.Listaevento.Count == 0); Assert.IsTrue(this.Carrito.Listamatricula.Count == 0); //Obtenemos el implemento 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); }
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 Reset() { implemento = null; implemento2 = null; lista = null; lista2 = null; dojo = null; }
public void M15_PruebaEliminarInventarioDatos() { FabricaDAOSqlServer.ObtenerDAOImplemento().Agregar(implemento3); FabricaDAOSqlServer.ObtenerDAOImplemento().eliminarInventarioDatos(implemento3.Id_Implemento, dojo); implemento2 = (Implemento)FabricaDAOSqlServer.ObtenerDAOImplemento().implementoInventarioDatosUltimo(); Assert.AreNotEqual(implemento.Marca_Implemento, implemento2.Marca_Implemento); Assert.AreNotEqual(implemento.Color_Implemento, implemento2.Color_Implemento); Assert.AreNotEqual(implemento.Talla_Implemento, implemento2.Talla_Implemento); Assert.AreNotEqual(implemento.Precio_Implemento, implemento2.Precio_Implemento); Assert.AreNotEqual(implemento.Cantida_implemento, implemento2.Cantida_implemento); Assert.AreNotEqual("Inactivo", implemento2.Estatus_Implemento); Assert.AreNotEqual(implemento.Stock_Minimo_Implemento, implemento2.Stock_Minimo_Implemento); Assert.AreNotEqual(implemento.Imagen_implemento, implemento2.Imagen_implemento); }
public void M15_PruebaAgregarInventarioDatos() { FabricaDAOSqlServer.ObtenerDAOImplemento().Agregar(implemento); implemento2 = (Implemento)FabricaDAOSqlServer.ObtenerDAOImplemento().implementoInventarioDatosUltimo(); Assert.AreEqual(implemento.Nombre_Implemento, implemento2.Nombre_Implemento); Assert.AreEqual(implemento.Tipo_Implemento, implemento2.Tipo_Implemento); Assert.AreEqual(implemento.Marca_Implemento, implemento2.Marca_Implemento); Assert.AreEqual(implemento.Color_Implemento, implemento2.Color_Implemento); Assert.AreEqual(implemento.Talla_Implemento, implemento2.Talla_Implemento); Assert.AreEqual(implemento.Precio_Implemento, implemento2.Precio_Implemento); Assert.AreEqual(implemento.Cantida_implemento, implemento2.Cantida_implemento); Assert.AreEqual("Activo", implemento2.Estatus_Implemento); Assert.AreEqual(implemento.Stock_Minimo_Implemento, implemento2.Stock_Minimo_Implemento); Assert.AreEqual(implemento.Imagen_implemento, implemento2.Imagen_implemento); }
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.pruebaComandoImplemento4 = null; this.pruebaComandoEvento1 = null; this.pruebaComandoEvento2 = null; this.pruebaComandoEvento3 = null; this.pruebaComandoEvento4 = null; this.pruebaComandoMatricula1 = null; this.pruebaComandoMatricula2 = null; this.pruebaComandoMatricula3 = null; this.pruebaComandoMatricula4 = null; this.eventos = null; this.persona = null; this.persona2 = null; this.persona3 = null; this.implemento = null; this.implemento2 = null; this.listaEventos = null; this.matricula = null; this.matricula2 = null; }
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; }
public void Limpiar() { 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.listaEventos = null; this.eventos = null; this.PruebaComandoVacio = null; this.PruebaComandoVacio2 = null; this.pruebaComandoVacio3 = null; this.pruebaComandoVacio4 = null; this.ComandoAgregarItem = null; this.ComandoRegistrarPago = null; this.ComandoRegistrarPago2 = null; this.ComandoRegistrarPago3 = null; this.ComandoRegistrarPago4 = null; this.ComandoRegistrarPago5 = null; this.ComandoRegistrarPago6 = 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); }