private void CreateEntities(JiraCredentials credential) { newUser = TestData.GetJiraUser(); createUserResult = UserSteps.CreateUser(credential, newUser); project = TestData.GetJiraProject(createUserResult.Data); createProjectResult = ProjectSteps.CreateProject(credential, project); }
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); } }
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); } }
private void TestAssignProject(JiraCredentials credential) { var newUser = TestData.GetJiraUser(); JiraCreateUserResult createUserResult = UserSteps.CreateUser(credential, newUser); var newProject = TestData.GetJiraProject(createUserResult.Data); ProjectSteps.CreateProject(credential, newProject); JiraProjectRolesResult roles = ProjectSteps.GetProjectRoles(credential); try { JiraAssignProjectModel assignProject; if (credential.JiraConnection == JiraConnectionType.JiraCloud) { assignProject = TestData.GetJiraAssignProject(newProject.Key, createUserResult.Data.AccountId, roles.Data[0].Id); } else { assignProject = TestData.GetJiraAssignProject(newProject.Key, createUserResult.Data.Key, roles.Data[0].Id); } JiraAssignProjectResult assignProjectResult = UserSteps.AssignProject(credential, assignProject); Assert.AreEqual(assignProjectResult.Status, JiraResultStatus.Success); } finally { try { ProjectSteps.DeleteProject(credential, newProject.ProjectIdOrKey); UserSteps.DeleteUser(credential, createUserResult.Data.Key); // for Jira server UserSteps.DeleteUser(credential, createUserResult.Data.AccountId); // for Jira cloud } catch { } } }