private static Action<Mock<IJiraProxy>> ExpectedMethodCalls(string ticket, string noQuotesComment, IssueResolution resolution, string fixedInVersions) { return proxyMock => proxyMock.Setup( p => p.ResolveIssue( ticket, It.Is<String>(remmark => remmark == noQuotesComment), resolution, It.Is<IEnumerable<string>>( versions => string.IsNullOrEmpty(fixedInVersions) ? true : versions.Any(version => IsValidVersion(fixedInVersions, version))) ) ).Returns(IssueTestService.Issue[ticket]); }
private void AssertResolve(string ticket, IssueResolution resolution, string comment, string fixedInVersions) { string noQuotesComment = StripQuotes(comment); using (var commandMock = NewCommand<ResolveIssueCommand>(ExpectedMethodCalls(ticket, noQuotesComment, resolution, fixedInVersions))) { var contextMock = ContextMockFor("resolving-user", String.Format("{0} \"{1}\"{2} {3}", ticket, resolution.Description.ToLower(), fixedInVersions, String.IsNullOrEmpty(comment) ? "" : (" " + comment))); contextMock.Setup(ctx => ctx.User.Name).Returns("unit.test.user"); var expectedOutput = string.Format("Issue {0} ('{1}') resolved as '{2}'.", ticket, IssueTestService.Issue[ticket].summary, resolution.Description); var result = commandMock.Process(contextMock.Object); Assert.AreEqual(expectedOutput, result.HumanReadable); Assert.AreEqual(ticket, result.PipeValue); } }
private static SolidColorBrush GetColorByIssueResolution(IssueResolution issueResolution) { string hex_code = "#FF304FFE"; switch (issueResolution) { case IssueResolution.Backlogged: hex_code = "#FF7F261D"; break; case IssueResolution.ByDesign: hex_code = "#FF27AE60"; break; case IssueResolution.CannotReproduce: hex_code = "#FFF39C12"; break; case IssueResolution.Duplicate: hex_code = "#FF95A5A6"; break; case IssueResolution.Fixed: hex_code = "#FF2ECC71"; break; case IssueResolution.NonIssue: hex_code = "#FFBBBBBB"; break; case IssueResolution.Unresolved: hex_code = "#FFE74C3C"; break; case IssueResolution.WontDo: hex_code = "#FF171717"; break; case IssueResolution.WontFix: hex_code = "#FF34495E"; break; default: break; } return((SolidColorBrush) new BrushConverter().ConvertFromString(hex_code)); }
public static IssueResolution GetResolution(string ResolutionName) { IssueResolution issueResolution = IssueResolution.None; switch (ResolutionName.ToLower()) { case "backlogged": issueResolution = IssueResolution.Backlogged; break; case "by design": issueResolution = IssueResolution.ByDesign; break; case "cannot reproduce": issueResolution = IssueResolution.CannotReproduce; break; case "duplicate": issueResolution = IssueResolution.Duplicate; break; case "fixed": issueResolution = IssueResolution.Fixed; break; case "non-issue": issueResolution = IssueResolution.NonIssue; break; case "unresolved": issueResolution = IssueResolution.Unresolved; break; case "won't do": issueResolution = IssueResolution.WontDo; break; case "won't fix": issueResolution = IssueResolution.WontFix; break; default: break; } return(issueResolution); }
private void AssertResolve(string ticket, IssueResolution resolution, string comment) { AssertResolve(ticket, resolution, comment, string.Empty); }
private void AssertResolve(string ticket, IssueResolution resolution) { AssertResolve(ticket, resolution, String.Empty); }
public void PostResolve([FromBody] IssueResolution resolution) { Operations.ResolveIssue(resolution); }