private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtCodigo, "Tiene que ingresar codigo"); result = validacion.estaVacioONull(error1, txtDescripcion, "Tiene que ingresar una Descripcion") || result; return(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtUsuario, "Tiene que ingresar su Usario"); result = validacion.estaVacioONull(error1, txtClave, "Tiene que ingresar su Clave") || result; return(result); }
private bool verificarExistencia(ClsNValidacion validacion) { bool result = validacion.existeCliente(error1, txtCliente, "El Cliente no Existe"); result = validacion.existeProducto(error1, txtProducto, "El Producto no Existe") && result; return(result); }
private bool rangoCaracteresCorrecto(ClsNValidacion validacion) { bool result = validacion.tieneRangoCaracteres(error1, txtTelefono, 6, 12, "El numero de Telefono tiene como minimo 6 y maximo 12 caracteres"); result = validacion.tieneRangoCaracteres(error1, txtDni, 8, 8, "El DNI tiene que tener 11 digitos") && result; return(result); }
public void testNoExisteProductoEnDataGridCodigoLabel_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "0001"; Label lbl = new Label(); lbl.Text = "Apple Watch"; DataGridView dgv = new DataGridView(); DataTable dt = new DataTable(); dt.Columns.Add("Codigo"); dt.Columns.Add("Descripcion"); dt.Columns.Add("Cantidad"); dt.Columns.Add("Precio Unitario"); dt.Columns.Add("Importe"); dt.Rows.Add("0002", "Apple Watch 2", "", "350", ""); dgv.DataSource = dt; string mensaje = "Error"; bool result = obj.existeProductoEnDataGrid(err, dgv, txt, mensaje, lbl); Assert.IsFalse(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtCliente, "Tiene que ingresar Cliente"); result = validacion.estaVacioONull(error1, txtProducto, "Tiene que ingresar un Producto") || result; return(result); }
private bool cmbOpcionSeleccionada(ClsNValidacion validacion) { bool result = validacion.tieneSeleccionCmb(error1, cmbCargo, "Seleccione un Cargo"); result = validacion.tieneSeleccionCmb(error1, cmbTurno, "Seleccione un Turno") && result; result = validacion.tieneSeleccionCmb(error1, cmbEstado, "Seleccione un Estado") && result; return(result); }
private bool MtdValidarCampos() { ClsNValidacion validacion = ClsNValidacion.getValidacion(); //validando que campos no esten vacios o null bool result = !existenVacios(validacion); return(result); }
public void testBotonHabilitado_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); bool expected = false; bool result = obj.boton(expected); Assert.IsFalse(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtRuc, "Tiene que ingresar RUC"); result = validacion.estaVacioONull(error1, txtNombre, "Tiene que ingresar un Nombre") || result; result = validacion.estaVacioONull(error1, txtDireccion, "Tiene que ingresar una Direccion") || result; result = validacion.estaVacioONull(error1, txtCorreo, "Tiene que ingresar un Correo") || result; result = validacion.estaVacioONull(error1, txtTelefono, "Tiene que ingresar un Numero de Tefono") || result; return(result); }
private bool comprobarContraseña(ClsNValidacion validacion) { bool result = validacion.contraseñaCorrecta(error1, lblUsuario, txtClave, "La contraseña ingresada no coincide con la actual"); if (cambiar) { result = validacion.compararContraseñaNueva(error1, txtClaveNueva, txtClaveRepe, "Las constraseñas no coinciden") && result; } return(result); }
private bool MtdValidarCampos() { ClsNValidacion validacion = ClsNValidacion.getValidacion(); //validando que campos no esten vacios o null bool result = existenVacios(validacion); //validando que se seleccione un opcion en el combobox result = cmbOpcionSeleccionada(validacion) && !result; return(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtDni, "Tiene que ingresar DNI"); result = validacion.estaVacioONull(error1, txtNombres, "Tiene que ingresar un Nombre") || result; result = validacion.estaVacioONull(error1, txtApellidos, "Tiene que ingresar Apellido") || result; result = validacion.estaVacioONull(error1, txtCorreo, "Tiene que ingresar un Correo") || result; result = validacion.estaVacioONull(error1, txtTelefono, "Tiene que ingresar un Numero de Tefono") || result; return(result); }
private bool rangoCaracteresCorrecto(ClsNValidacion validacion) { bool result = validacion.tieneRangoCaracteres(error1, txtTelefono, 6, 12, "El numero de Telefono tiene como minimo 6 y maximo 12 caracteres"); result = validacion.tieneRangoCaracteres(error1, txtClave, 6, 6, "La contraseña tiene que tener 6 digitos") && result; if (cambiar) { result = validacion.tieneRangoCaracteres(error1, txtClaveNueva, 6, 6, "La contraseña tiene que tener 6 digitos") && result; result = validacion.tieneRangoCaracteres(error1, txtClaveRepe, 6, 6, "La contraseña tiene que tener 6 digitos") && result; } return(result); }
public void testEstaVacioONull_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "Hola"; string mensaje = "Error"; bool result = obj.estaVacioONull(err, txt, mensaje); Assert.IsFalse(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtDni, "Tiene que ingresar DNI"); result = validacion.estaVacioONull(error1, txtNombres, "Tiene que ingresar Nombres") || result; result = validacion.estaVacioONull(error1, txtApellidos, "Tiene que ingresar Apellidos") || result; result = validacion.estaVacioONull(error1, txtDireccion, "Tiene que ingresar una Direccion") || result; result = validacion.estaVacioONull(error1, txtCorreo, "Tiene que ingresar un Correo") || result; result = validacion.estaVacioONull(error1, txtTelefono, "Tiene que ingresar un Numero de Tefono") || result; result = validacion.estaVacioONull(error1, txtUsuario, "Tiene que ingresar un Nombre de Usuario") || result; result = validacion.estaVacioONull(error1, txtContraseña, "Tiene que ingresar una Contraseña") || result; return(result); }
public void testExisteClienteDni_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "00491420"; string mensaje = "Error"; bool result = obj.existeCliente(err, txt, mensaje); Assert.IsTrue(result); }
public void testComboBoxNoTieneSeleccionCmb_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); ComboBox cmb = new ComboBox(); cmb.SelectedIndex = -1; string mensaje = "Error"; bool result = obj.tieneSeleccionCmb(err, cmb, mensaje); Assert.IsFalse(result); }
public void testExisteClienteNombre_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "NORA GLENDA PONCE PALZA"; string mensaje = "Error"; bool result = obj.existeCliente(err, txt, mensaje); Assert.IsTrue(result); }
public void testExisteCargo_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "Administrador"; string mensaje = "Error"; bool result = obj.existeCargo(err, txt, mensaje); Assert.IsFalse(result); }
public void testTextoSinArrobaTieneFormatoCorreo_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "pruebagmail.com"; string mensaje = "Error"; bool result = obj.tieneFormatoCorreo(err, txt, mensaje); Assert.IsFalse(result); }
public void testExisteProductoCodigo_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "0001"; string mensaje = "Error"; bool result = obj.existeProducto(err, txt, mensaje); Assert.IsTrue(result); }
public void testNoExisteProductoNombre_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "---------------"; string mensaje = "Error"; bool result = obj.existeProducto(err, txt, mensaje); Assert.IsFalse(result); }
public void TestMethod1() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "Hola"; string mensaje = "Error"; bool result = obj.estaVacioONull(err, txt, mensaje); Assert.IsTrue(!result); }
private bool validarCampos() { ClsNValidacion validacion = ClsNValidacion.getValidacion(); //validando que campos no esten vacios o null bool result = !existenVacios(validacion); if (result) { //comprobar que el nombre de cargo no exista result = verificarExistenca(validacion) && result; } return(result); }
private bool MtdValidarCampos() { ClsNValidacion validacion = ClsNValidacion.getValidacion(); //validando que campos no esten vacios o null bool result = !existenVacios(validacion); if (result) { //validando cantidad de caracteres result = rangoCaracteresCorrecto(validacion) && result; } return(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtCodigo, "Tiene que ingresar Codigo"); result = validacion.estaVacioONull(error1, txtNombre, "Tiene que ingresar un Nombre") || result; result = validacion.estaVacioONull(error1, txtColor, "Tiene que ingresar una Color") || result; result = validacion.estaVacioONull(error1, txtPeso, "Tiene que ingresar el Peso") || result; result = validacion.estaVacioONull(error1, txtSistemaOperativo, "Tiene que ingresar un Sistema Operativo") || result; result = validacion.estaVacioONull(error1, txtCantidad, "Tiene que ingresar la Cantidad") || result; result = validacion.estaVacioONull(error1, txtPrecio, "Tiene que ingresar el Precio") || result; result = validacion.estaVacioONull(error1, txtForma, "Tiene que ingresar la Forma") || result; result = validacion.estaVacioONull(error1, txtMemoriaInterna, "Tiene que ingresar la Memoria Interna") || result; return(result); }
public void testComboBoxTieneSeleccionCmb_returnTrue() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); ComboBox cmb = new ComboBox(); object[] elementos = { "Hola", "como", "estas" }; cmb.Items.AddRange(elementos); cmb.SelectedIndex = 0; string mensaje = "Error"; bool result = obj.tieneSeleccionCmb(err, cmb, mensaje); Assert.IsTrue(result); }
public void testTextoTieneRangoCaracteres_returnFalse() { ClsNValidacion obj = ClsNValidacion.getValidacion(); ErrorProvider err = new ErrorProvider(); TextBox txt = new TextBox(); txt.Text = "Hola como estas hoy"; string mensaje = "Error"; int min = 10; int max = 15; bool result = obj.tieneRangoCaracteres(err, txt, min, max, mensaje); Assert.IsFalse(result); }
private bool existenVacios(ClsNValidacion validacion) { bool result = validacion.estaVacioONull(error1, txtUsuario, "Tiene que ingresar su Nombre de Usuario"); result = validacion.estaVacioONull(error1, txtDireccion, "Tiene que ingresar una Direccion") || result; result = validacion.estaVacioONull(error1, txtCorreo, "Tiene que ingresar un Correo") || result; result = validacion.estaVacioONull(error1, txtTelefono, "Tiene que ingresar un Numero de Telefono") || result; result = validacion.estaVacioONull(error1, txtClave, "Tiene que ingresar su contraseña actual para poder guardar los cambios") || result; if (cambiar) { result = validacion.estaVacioONull(error1, txtClaveNueva, "Tiene que ingresar su contraseña nueva") || result; result = validacion.estaVacioONull(error1, txtClaveRepe, "Tiene que repetir su contraseña nueva") || result; } return(result); }