Beispiel #1
0
        public void FindByIdTest(int studentId)
        {
            daoFactory    = new StudentDAOFactory();
            studentDaoTxt = daoFactory.CreateStudentDAOTxt();
            Student found = studentDaoTxt.FindById(studentId);

            Assert.IsNotNull(found);
        }
Beispiel #2
0
        public void AddTest(int id, string name, string surname, string day, string month, string year)
        {
            daoFactory    = new StudentDAOFactory();
            studentDaoTxt = daoFactory.CreateStudentDAOTxt();
            string dateString = day + "/" + month + "/" + year;

            //We can use Convert.ToDateTime(dateString) instead of the utility method StringToDateTimeES(dateString)
            Student student         = new Student(id, name, surname, DateUtilities.StringToDateTimeES(dateString));
            Student insertedStudent = studentDaoTxt.Add(student);

            //We can use Assert.AreEqual(student, insertedStudent)
            Assert.IsTrue(student.Equals(insertedStudent));
        }
Beispiel #3
0
 private void InitializeStudentDAOs()
 {
     studentDAOTxt  = studentDAOFactory.CreateStudentDAOTxt();
     studentDAOXml  = studentDAOFactory.CreateStudentDAOXml();
     studentDAOJson = studentDAOFactory.CreateStudentDAOJson();
 }