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(); studentDaoJson = daoFactory.CreateStudentDAOJson(); string dateString = day + "/" + month + "/" + year; Student student = new Student(id, name, surname, DateUtilities.StringToDateTimeES(dateString)); Student insertedStudent = studentDaoJson.Add(student); Assert.IsTrue(student.Equals(insertedStudent)); }
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 InitializeDAOFactory() { studentDAOFactory = new StudentDAOFactory(); }