public void AddSubjectSuccess() { ClearRepository(); Subject newSubjectTest = testSubject(); SubjectLogic testLogic = new SubjectLogic(); testLogic.Add(newSubjectTest); Assert.IsTrue(testLogic.Exists(newSubjectTest)); }
public void DeleteSubjectSuccess() { ClearRepository(); Subject newSubject = testSubject(); SubjectLogic testLogic = new SubjectLogic(); testLogic.Add(newSubject); testLogic.Remove(newSubject); Assert.IsFalse(testLogic.Exists(newSubject)); }
public void ModifyNonExistentSubject() { ClearRepository(); Subject newSubject = testSubject(); Subject editedSubject = new Subject(); SubjectLogic testLogic = new SubjectLogic(); string testCode = "3"; editedSubject.Code = testCode; testLogic.Modify(newSubject, editedSubject); Assert.IsFalse(testLogic.Exists(editedSubject)); }
public void ModifySubjectFailOldSubject() { ClearRepository(); SubjectLogic testLogic = new SubjectLogic(); Subject newSubject = testSubject(); Subject anotherSubject = new Subject(); string emptyCode = ""; anotherSubject.Code = emptyCode; testLogic.Add(newSubject); testLogic.Modify(newSubject, anotherSubject); testLogic.Exists(newSubject); }
public void ModifySubjectSuccess() { ClearRepository(); Subject newSubject = testSubject(); Subject editedSubject = testSubject(); SubjectLogic testLogic = new SubjectLogic(); string testName = "3"; editedSubject.Name = testName; testLogic.Add(newSubject); testLogic.Modify(newSubject, editedSubject); Assert.IsTrue(testLogic.Exists(editedSubject)); }
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)); }