Exemplo n.º 1
0
        private void TestGetProjectRoles(JiraCredentials credential)
        {
            CreateEntities(credential);
            JiraProjectModel project = TestData.GetJiraProject(createUserResult.Data);

            try
            {
                ProjectSteps.CreateProject(credential, project);

                var response = ProjectSteps.GetProjectRoles(credential);
                Assert.AreEqual(response.Status, JiraResultStatus.Success);
            }
            finally
            {
                ProjectSteps.DeleteProject(credential, project.ProjectIdOrKey);
                DeleteEntities(credential);
            }
        }
Exemplo n.º 2
0
        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 { }
            }
        }