public void IssueFormattingTest() { string link = "https://github.com/bla/bla-blas"; IssueInformation singleFailureIssue = new IssueInformation(null, "glimpse", null, new Uri("https://www.helpUri.com"), "ruleSource", "ruleDescription", "testMessages", null, null, "elementPath", null, null, "processName", IssueType.SingleFailure, null); IssueInformation noFailureIssue = new IssueInformation(null, "glimpse", null, new Uri("https://www.helpUri.com"), "ruleSource", "ruleDescription", "testMessages", null, null, "elementPath", null, null, "processName", IssueType.NoFailure, null); IIssueFormatter singleIssueFormatter = new SingleFailureIssueFormatter(singleFailureIssue); IIssueFormatter noIssueFormatter = new NoFailuresIssueFormatter(noFailureIssue); string singleFailureLinkActual = IssueFormatterFactory.GetNewIssueLink(link, singleFailureIssue); string singleFailureLinkExpected = GetLink(link, singleIssueFormatter); string noFailureLinkActual = IssueFormatterFactory.GetNewIssueLink(link, noFailureIssue); string noFailureLinkExpected = GetLink(link, noIssueFormatter); Assert.AreEqual(singleFailureLinkExpected, singleFailureLinkActual); Assert.AreEqual(noFailureLinkExpected, noFailureLinkActual); Assert.AreNotEqual(singleFailureLinkExpected, noFailureLinkActual); Assert.AreNotEqual(noFailureLinkExpected, singleFailureLinkActual); }
private IIssueResult FileIssueAsyncAction(IssueInformation issueInfo) { if (this.IsConfigured) { try { string url = IssueFormatterFactory.GetNewIssueLink(this.configurationControl.Config.RepoLink, issueInfo); System.Diagnostics.Process.Start(url); } catch (Exception e) { e.ReportException(); MessageDialog.Show(Properties.Resources.InvalidLink); } } return(null); }
private IIssueResult FileIssueAsyncAction(IssueInformation issueInfo) { if (this.IsConfigured) { try { string url = IssueFormatterFactory.GetNewIssueLink(this.configurationControl.Config.RepoLink, issueInfo); System.Diagnostics.Process.Start(url); } #pragma warning disable CA1031 // Do not catch general exception types catch (Exception e) { e.ReportException(); MessageDialog.Invoke(Properties.Resources.InvalidLink); } #pragma warning restore CA1031 // Do not catch general exception types } return(null); }
public void GetNewIssue_IssueInfoIsNull_ThrowsArgumentNullException() { IssueFormatterFactory.GetNewIssueLink(string.Empty, null); }