public void removeTest() { Person p = new Person(); p.FirstName = "laura"; p.LastName = "rodriguez"; int id = PersonManager.add(p); bool elimina = PersonManager.remove(id); Assert.AreEqual(elimina,true); }
protected void btnADDPersona(object sender, EventArgs e) { if (this.IsPostBack) { this.Validate(); if (this.IsValid) { Person p = new Person(); p.LastName = this.txtApellidos.Text; p.FirstName = this.txtNombre.Text; p.HireDate = Convert.ToDateTime(this.txtFechaIngreso.Text); p.EnrollmentDate = Convert.ToDateTime(this.txtFechaInscripcion.Text); int id = PersonManager.add(p); Response.Redirect("persona.aspx"); } } }
public void getAllTest() { List<Person> pers = new List<Person>(); pers = PersonManager.getAll(); int numero = pers.Count; Person p = new Person(); p.FirstName = "laura"; p.LastName = "rodriguez"; int id = PersonManager.add(p); pers = PersonManager.getAll(); int numero2 = pers.Count; Assert.AreEqual(numero+1,numero2); bool elimina = PersonManager.remove(id); pers = PersonManager.getAll(); int numero3 = pers.Count; Assert.AreEqual(numero, numero3); }
public void getTest() { Person per = new Person(); per= PersonManager.get(1); Assert.AreEqual(per.FirstName, "Kim"); }