Beispiel #1
0
 private void CreateEntities(JiraCredentials credential)
 {
     newUser             = TestData.GetJiraUser();
     createUserResult    = UserSteps.CreateUser(credential, newUser);
     project             = TestData.GetJiraProject(createUserResult.Data);
     createProjectResult = ProjectSteps.CreateProject(credential, project);
 }
Beispiel #2
0
        public void Edit()
        {
            JiraProjectModel userModel = new JiraProjectModel
            {
                ProjectIdOrKey = "DW",
                Description    = "Test Desc",
                Name           = "Dec_wfh_1",
                Key            = "DW"
            };
            HttpStatusCode actualStatusCode   = Project.Edit(userModel).Status;
            HttpStatusCode expectedStatusCode = HttpStatusCode.OK;

            Assert.AreEqual(expectedStatusCode, actualStatusCode);
        }
Beispiel #3
0
        private void TestCreateProject(JiraCredentials credential)
        {
            CreateEntities(credential);
            JiraProjectModel project = TestData.GetJiraProject(createUserResult.Data);

            try
            {
                var response = ProjectSteps.CreateProject(credential, project);
                Assert.AreEqual(response.Status, JiraResultStatus.Success);
            }
            finally
            {
                ProjectSteps.DeleteProject(credential, project.ProjectIdOrKey);
                DeleteEntities(credential);
            }
        }
Beispiel #4
0
        public void Create()
        {
            JiraProjectModel userModel = new JiraProjectModel
            {
                Description        = "New Project123",
                Name               = "Test123",
                Key                = "NP123",
                ProjectTemplateKey = "com.pyxis.greenhopper.jira:gh-simplified-agility-kanban",
                LeadAccountId      = "5ea1ce8c1f32260c13047996",
                AssigneeType       = "UNASSIGNED",
                ProjectTypeKey     = "business"
            };
            HttpStatusCode actualStatusCode   = Project.Create(userModel).Status;
            HttpStatusCode expectedStatusCode = HttpStatusCode.Created;

            Assert.AreEqual(expectedStatusCode, actualStatusCode);
        }
Beispiel #5
0
        private void TestEditProject(JiraCredentials credential)
        {
            CreateEntities(credential);

            JiraProjectModel project = TestData.GetJiraProject(createUserResult.Data);

            try
            {
                var createResponse = ProjectSteps.CreateProject(credential, project);

                project.Description = "Test Desc";
                project.Name        = "Dec_wfh_1";

                var editResponse = ProjectSteps.EditProject(credential, project);
                Assert.AreEqual(editResponse.Status, JiraResultStatus.Success);
            }
            finally
            {
                ProjectSteps.DeleteProject(credential, project.ProjectIdOrKey);
                DeleteEntities(credential);
            }
        }
Beispiel #6
0
        public static JiraCreateProjectResult CreateProject(JiraCredentials credential, JiraProjectModel newProject)
        {
            var response = JiraUtility.Post <JiraProjectModel, JiraBaseResponseModel>("project", credential, newProject, HttpStatusCode.Created);

            return(new JiraCreateProjectResult(response));
        }
Beispiel #7
0
        public static JiraEditProjectResult EditProject(JiraCredentials credential, JiraProjectModel projectModel)
        {
            var response = JiraUtility.Put <JiraProjectModel, JiraEditProjectResponseModel>($"project/{projectModel.ProjectIdOrKey}", credential, projectModel, HttpStatusCode.OK);

            return(new JiraEditProjectResult(response));
        }