Esempio n. 1
0
        public void AssignEmployeeTest()
        {
            ProjectSqlDAL projectTest = new ProjectSqlDAL(connectionString);
            bool          isAssigned  = projectTest.AssignEmployeeToProject(6, 1);

            Assert.IsTrue(isAssigned);
        }
        public void AssignEmployeeToProjectTest()
        {
            ProjectSqlDAL project    = new ProjectSqlDAL(connectionString);
            bool          isAssigned = project.AssignEmployeeToProject(1, 2);

            Assert.AreEqual(true, isAssigned);
        }
        public void AssignProjects()
        {
            ProjectSqlDAL projDal = new ProjectSqlDAL(connectionString);
            bool          proj    = projDal.AssignEmployeeToProject(5, 3);

            Assert.AreEqual(true, proj);
        }
        public void AssignToProject()
        {
            ProjectSqlDAL projectSqlDal = new ProjectSqlDAL(connectionString);
            bool          didWork       = projectSqlDal.AssignEmployeeToProject(projectId, employeeId);

            Assert.AreEqual(true, didWork);
        }
        public void AssignEmployeeToProjectTest()
        {
            ProjectSqlDAL projectSqlDAL = new ProjectSqlDAL(connectionString);
            bool          result        = projectSqlDAL.AssignEmployeeToProject(5, 2);

            Assert.IsTrue(result);
        }
Esempio n. 6
0
        public void RemoveEmployeeFromProjectTest()
        {
            ProjectSqlDAL projectSqlDAL = new ProjectSqlDAL(connectionString);

            bool didItWork = projectSqlDAL.AssignEmployeeToProject(newProjectID, newEmployeeID);

            Assert.IsTrue(didItWork);
        }
        public void AssignEmployeeToProjectTest()
        {
            ProjectSqlDAL sqlProject = new ProjectSqlDAL(connectionString);

            bool result = sqlProject.AssignEmployeeToProject(1, 1);

            Assert.AreEqual(true, result);
        }
        public void AssignEmployeeToProjectTest()
        {
            ProjectSqlDAL projectSqldal = new ProjectSqlDAL(connectionString);

            bool didWork = projectSqldal.AssignEmployeeToProject(1, 4);

            Assert.AreEqual(true, didWork);
        }
Esempio n. 9
0
        public void AssignEmployeeProjectTest()
        {
            ProjectSqlDAL project = new ProjectSqlDAL(connectionString);
            bool          result  = false;

            result = project.AssignEmployeeToProject(maxProjectID, maxEmployeeID);
            Assert.IsTrue(result);
        }
Esempio n. 10
0
        public void AssignEmployeeToProject_Test()
        {
            ProjectSqlDAL projectTest = new ProjectSqlDAL(connectionString);

            bool didWork = projectTest.AssignEmployeeToProject(projectId, employeeId);

            Assert.IsTrue(didWork);
        }
        public void AssignEmployeeToProjectTest()
        {
            //Arrange
            ProjectSqlDAL projectDAL = new ProjectSqlDAL(connectionString);

            //Act
            bool wasSuccesful = projectDAL.AssignEmployeeToProject(2, 5);

            //Assert
            Assert.AreEqual(true, wasSuccesful);
        }
Esempio n. 12
0
        public void AssignEmployeeToExistingProject()
        {
            //Arrange
            ProjectSqlDAL dal = new ProjectSqlDAL(ConnectionString);

            //Act
            bool result = dal.AssignEmployeeToProject(testProjectId, testEmpId2);

            //Assert
            Assert.IsTrue(result);
        }
        public void RemoveFromProject()
        {
            ProjectSqlDAL projectSqlDal = new ProjectSqlDAL(connectionString);
            bool          didWork       = projectSqlDal.AssignEmployeeToProject(projectId, employeeId);
            bool          wasRemoved    = false;

            if (didWork)
            {
                wasRemoved = projectSqlDal.RemoveEmployeeFromProject(projectId, employeeId);
            }
            Assert.AreEqual(true, wasRemoved);
        }
        public void ProjectsTest()
        {
            Project thisProj = new Project();

            thisProj.Name      = "TESTprojTEST";
            thisProj.StartDate = DateTime.Now;
            thisProj.EndDate   = DateTime.Now;

            ProjectSqlDAL psdTest = new ProjectSqlDAL(connectionString);

            Assert.AreEqual(true, psdTest.CreateProject(thisProj));
            Assert.AreEqual(projectCount + 1, psdTest.GetAllProjects().Count);

            Assert.AreEqual(true, psdTest.AssignEmployeeToProject(projectCount, 1));
            Assert.AreEqual(true, psdTest.RemoveEmployeeFromProject(projectCount, 1));
            Assert.AreNotEqual(true, psdTest.RemoveEmployeeFromProject(projectCount + 1, 1));
        }
Esempio n. 15
0
        private void AssignEmployeeToProject()
        {
            int projectId  = CLIHelper.GetInteger("Which project id is the employee assigned to:");
            int employeeId = CLIHelper.GetInteger("Which employee is getting added:");

            ProjectSqlDAL dal    = new ProjectSqlDAL(DatabaseConnection);
            bool          result = dal.AssignEmployeeToProject(projectId, employeeId);

            if (result)
            {
                Console.WriteLine("*** SUCCESS ***");
            }
            else
            {
                Console.WriteLine("*** DID NOT CREATE ***");
            }
        }
Esempio n. 16
0
        public void TestAssignEmployee()
        {
            //Arrange
            ProjectSqlDAL projectDAL = new ProjectSqlDAL(connectionString);

            //Act
            bool employeeAssigned = projectDAL.AssignEmployeeToProject(1, 1);

            //Assert
            int alteredprojects = 0;

            using (SqlConnection connection = new SqlConnection(connectionString))
            {
                SqlCommand cmd;
                connection.Open();

                cmd = new SqlCommand("SELECT COUNT(*) FROM project_employee;", connection);

                alteredprojects = (int)cmd.ExecuteScalar();
            }

            Assert.AreEqual(employeeProjectCount + 1, alteredprojects);
        }
 public void AssignEmployeeToProjectTest()
 {
     Assert.IsTrue(test.AssignEmployeeToProject(2, 7));
 }
 public void AssignEmployeeToProjectTest()
 {
     ProjectSqlDAL newProject = new ProjectSqlDAL(connectionString);
     bool          worked     = newProject.AssignEmployeeToProject(projectId, employeeId);
 }