public void DeleteSubjectSuccess() { ClearRepository(); Subject newSubject = testSubject(); SubjectLogic testLogic = new SubjectLogic(); testLogic.Add(newSubject); testLogic.Remove(newSubject); Assert.IsFalse(testLogic.Exists(newSubject)); }
public void RemoveSubject(object selectedObject) { if (!(selectedObject is Subject)) { throw new WrongObjectException("Se esperaba un objeto del tipo [Subject]"); } Subject toDelete = selectedObject as Subject; SubjectLogic logic = new SubjectLogic(); logic.Remove(toDelete); }
public void DeleteSubjectFail() { ClearRepository(); Subject newSubject = testSubject(); string testCode = "5"; newSubject.Code = testCode; Subject anotherNewSubject = testSubject(); string anotherTestCode = "6"; anotherNewSubject.Code = anotherTestCode; SubjectLogic testLogic = new SubjectLogic(); testLogic.Add(newSubject); testLogic.Remove(anotherNewSubject); Assert.IsTrue(testLogic.Exists(newSubject)); }