public void FindByIdTest(int studentId) { daoFactory = new StudentDAOFactory(); studentDaoTxt = daoFactory.CreateStudentDAOTxt(); Student found = studentDaoTxt.FindById(studentId); Assert.IsNotNull(found); }
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)); }
private void InitializeStudentDAOs() { studentDAOTxt = studentDAOFactory.CreateStudentDAOTxt(); studentDAOXml = studentDAOFactory.CreateStudentDAOXml(); studentDAOJson = studentDAOFactory.CreateStudentDAOJson(); }