示例#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);
 }
示例#2
0
        private void TestEditUser(JiraCredentials credential)
        {
            var editedUser = TestData.GetJiraUser();
            JiraCreateUserResult createUserResult = UserSteps.CreateUser(credential, editedUser);

            JiraUserModel newUserData = new JiraUserModel
            {
                DisplayName  = "edited" + editedUser.DisplayName,
                EmailAddress = "edited" + editedUser.EmailAddress,
                Name         = "edited" + editedUser.Name,
                Password     = null
            };

            try
            {
                var EditUserResult = UserSteps.EditUser(credential, createUserResult.Data.Key, newUserData);
                Assert.AreEqual(EditUserResult.Status, JiraResultStatus.Success);
            }
            finally
            {
                try
                {
                    UserSteps.DeleteUser(credential, createUserResult.Data.Key);       // for Jira server
                    UserSteps.DeleteUser(credential, createUserResult.Data.AccountId); // for Jira cloud
                }
                catch { }
            }
        }
示例#3
0
        private void TestCreateUser(JiraCredentials credential)
        {
            var newUser = TestData.GetJiraUser();
            JiraCreateUserResult createUserResult = UserSteps.CreateUser(credential, newUser);

            Assert.AreEqual(createUserResult.Status, JiraResultStatus.Success);

            UserSteps.DeleteUser(credential, createUserResult.Data.AccountId); // for Jira Cloud
            UserSteps.DeleteUser(credential, createUserResult.Data.Key);       // for Jira server
        }
示例#4
0
        private void TestDeleteUser(JiraCredentials credential)
        {
            var newUser = TestData.GetJiraUser();
            JiraCreateUserResult createUserResult = UserSteps.CreateUser(credential, newUser);

            BaseJiraResult deleteResult;

            if (credential.JiraConnection == JiraConnectionType.JiraCloud)
            {
                deleteResult = UserSteps.DeleteUser(credential, createUserResult.Data.AccountId);
            }
            else
            {
                deleteResult = UserSteps.DeleteUser(credential, createUserResult.Data.Key);
            }

            Assert.AreEqual(deleteResult.Status, JiraResultStatus.Success);
        }
示例#5
0
        private void TestSetUserPassword(JiraCredentials credential)
        {
            var editedUser = TestData.GetJiraUser();
            JiraCreateUserResult createUserResult = UserSteps.CreateUser(credential, editedUser);

            try
            {
                var serPasswordResult = UserSteps.SetUserPassword(credential, createUserResult.Data.Key, "123");
                Assert.AreEqual(serPasswordResult.Status, JiraResultStatus.Success);
            }
            finally
            {
                try
                {
                    UserSteps.DeleteUser(credential, createUserResult.Data.Key);       // for Jira server
                    UserSteps.DeleteUser(credential, createUserResult.Data.AccountId); // for Jira cloud
                }
                catch { }
            }
        }
示例#6
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 { }
            }
        }
示例#7
0
 private void CreateEntities(JiraCredentials credential)
 {
     newUser          = TestData.GetJiraUser();
     createUserResult = UserSteps.CreateUser(credential, newUser);
 }