public void RemoveActivity(object selectedObject) { if (!(selectedObject is Activity)) { throw new WrongObjectException("Se esperaba un objeto del tipo [Activity]"); } Activity toDelete = selectedObject as Activity; ActivityLogic logic = new ActivityLogic(); logic.Remove(toDelete); }
public void RemoveActivitySuccess() { SetUp(); ActivityLogic testLogic = new ActivityLogic(); Activity anActivity = testActivity(); testLogic.Add(anActivity); int id = GetLastActivityInDB().Id; anActivity.Id = GetLastActivityInDB().Id; testLogic.Remove(anActivity); Assert.IsFalse(testLogic.Exists(anActivity)); }