//------------------------------------------------------------------------------------------------------------------------ private void btn_AgregarVoluntario_Click(object sender, EventArgs e) { //Variable guarda la fecha del DateTimePicker y lo pasa a String var fechadtpVoluntario = dtp_FechaInscripcionVoluntario.Value.ToString("yyyy-MM-dd"); //Instancias de ClienteDePersonas, AgregarPersona y Proxy AgregarPersona agregar = new AgregarPersona(); Proxy proxy = new Proxy(); ClienteDePersonas cliente = new ClienteDePersonas(); //Método cliente.CrearVoluntario devuelve objeto Tipo Persona y se guarda en la variable volunt var voluntario = cliente.CrearVoluntario(txt_IdentificaciónVoluntario.Text, fechadtpVoluntario, txt_NombreVoluntario.Text, txt_Apellido1Voluntario.Text, txt_Apellido2Voluntario.Text, txt_TelefonoVoluntario.Text, txt_ProfesionVoluntario.Text, txt_DomicilioVoluntario.Text, cmb_InscripcionVoluntario.Text, cmb_DonacionVoluntario.Text, txt_CorreoVoluntario.Text); //Método agrega el Voluntario agregar.AgregarVoluntario(voluntario, proxy); //Se crea la lista List <IPersona> list = new List <IPersona>(); //Sse agrega a la lista list.Add(voluntario); //Se crea el visitor IVisitante datos = new SetDatos(); datos.VisitorAceptar(list); }
public void AgregarVoluntario_InformacionCorrecta_True() { //Arrange var esperado = true; AgregarPersona agregar = new AgregarPersona(); Proxy proxy = new Proxy(); ClienteDePersonas cliente = new ClienteDePersonas(); Persona voluntario = cliente.CrearVoluntario("117250594", "2018-10-04", "Steven", "Hernandez", "Guadamuz", "84571245", "Cirujano Plastico", "Desampa", "Trimestral", "Economica", "*****@*****.**"); //Act var resultado = agregar.AgregarVoluntario(voluntario, proxy); //Assert Assert.AreEqual(resultado, esperado); }