Пример #1
0
        public void EmployeeDAOUpdateTwiceShouldReturnNegative2()
        {
            EmployeeDAO dao = new EmployeeDAO();

            Employee emp1 = dao.GetByID("56201441f748f20bb0a3614c"); // Smartypants Id
            Employee emp2 = dao.GetByID("56201441f748f20bb0a3614c");

            emp1.Phoneno = "555-555-5551";
            int rowsUp = dao.Update(emp1);

            emp2.Phoneno = "555-555-5552";

            if (rowsUp == 1)
                rowsUp = dao.Update(emp2);
            Assert.IsTrue(rowsUp == -2);
        }
Пример #2
0
        public void EmployeeDAOUpdateShouldReturnTrue()
        {
            EmployeeDAO dao = new EmployeeDAO();
            Employee emp = dao.GetByID("56201441f748f20bb0a3614c"); // Smartypants ID
            emp.Phoneno = "555-555-5551";
            int rowsUpdated = dao.Update(emp);

            Assert.IsTrue(rowsUpdated == 1);
        }