public void RemoveTeacher(object selectedObject) { if (!(selectedObject is Teacher)) { throw new WrongObjectException("Se esperaba un objeto del tipo [Teacher]"); } Teacher toDelete = selectedObject as Teacher; TeacherLogic logic = new TeacherLogic(); logic.Remove(toDelete); }
public void DeleteTeacherSuccess() { SetUp(); TeacherLogic testLogic = new TeacherLogic(); Teacher newTeacher = new Teacher(); newTeacher.Id = 4; newTeacher.Name = "toDelete"; testLogic.Add(newTeacher); testLogic.Remove(newTeacher); Assert.IsFalse(testLogic.Exists(newTeacher)); }