예제 #1
0
        public void AddSubjectSuccess()
        {
            ClearRepository();
            Subject      newSubjectTest = testSubject();
            SubjectLogic testLogic      = new SubjectLogic();

            testLogic.Add(newSubjectTest);
            Assert.IsTrue(testLogic.Exists(newSubjectTest));
        }
예제 #2
0
        public void DeleteSubjectSuccess()
        {
            ClearRepository();
            Subject      newSubject = testSubject();
            SubjectLogic testLogic  = new SubjectLogic();

            testLogic.Add(newSubject);
            testLogic.Remove(newSubject);
            Assert.IsFalse(testLogic.Exists(newSubject));
        }
예제 #3
0
        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));
        }
예제 #4
0
        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);
        }
예제 #5
0
        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));
        }
예제 #6
0
        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));
        }