Ejemplo n.º 1
0
        public void GenerateNewCodeSuccess()
        {
            ClearRepository();
            string       testCode = "testCode";
            SubjectLogic logic    = new SubjectLogic();

            logic.AddNewSubject("testName");
            List <Subject> allSubjects = logic.GetAllSubjects();
            bool           assertion   = true;

            if (!logic.IsEmpty())
            {
                Subject subjectTest = allSubjects.ElementAt(0);
                assertion = subjectTest.Code.Equals(testCode);
            }
            Assert.IsFalse(assertion);
        }
Ejemplo n.º 2
0
        public void CanIModifySubject()
        {
            ClearRepository();
            Subject oldSubject = testSubject();
            Subject newSubject = testSubject();

            newSubject.Name = "aa";
            SubjectLogic logic = new SubjectLogic();

            logic.Add(oldSubject);
            logic.Modify(oldSubject, newSubject);
            List <Subject> allSubjects = logic.GetAllSubjects();
            bool           assertion   = false;

            if (!logic.IsEmpty())
            {
                Subject subjectTest = allSubjects.ElementAt(0);
                assertion = subjectTest.Name.Equals("aa");
            }
            Assert.IsTrue(assertion);
        }