Esempio n. 1
0
            public void Should_Return_Correct_Value(
                AzureDevOpsCommentThreadStatus status,
                PullRequestDiscussionResolution expectedResult)
            {
                // Given

                // When
                var result = status.ToPullRequestDiscussionResolution();

                // Then
                result.ShouldBe(expectedResult);
            }
        /// <summary>
        /// Converts a <see cref="AzureDevOpsCommentThreadStatus"/> from Azure DevOps to a <see cref="PullRequestDiscussionStatus"/> as used in this addin.
        /// </summary>
        /// <param name="status">Azure DevOps status to convert.</param>
        /// <returns>Converted status.</returns>
        public static PullRequestDiscussionStatus ToPullRequestDiscussionStatus(this AzureDevOpsCommentThreadStatus status)
        {
            switch (status)
            {
            case AzureDevOpsCommentThreadStatus.Unknown:
                return(PullRequestDiscussionStatus.Unknown);

            case AzureDevOpsCommentThreadStatus.Active:
            case AzureDevOpsCommentThreadStatus.Pending:
                return(PullRequestDiscussionStatus.Active);

            case AzureDevOpsCommentThreadStatus.Fixed:
            case AzureDevOpsCommentThreadStatus.WontFix:
            case AzureDevOpsCommentThreadStatus.Closed:
            case AzureDevOpsCommentThreadStatus.ByDesign:
                return(PullRequestDiscussionStatus.Resolved);

            default:
                throw new PullRequestIssuesException("Unknown enumeration value");
            }
        }