コード例 #1
0
        public void DeleteSubjectSuccess()
        {
            ClearRepository();
            Subject      newSubject = testSubject();
            SubjectLogic testLogic  = new SubjectLogic();

            testLogic.Add(newSubject);
            testLogic.Remove(newSubject);
            Assert.IsFalse(testLogic.Exists(newSubject));
        }
コード例 #2
0
        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);
        }
コード例 #3
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));
        }