public void ConfirmSelection_WhenInsertedIssueIsNotNumeric_ShouldShowMessageAndExit(string issue) { A.CallTo(() => m_view.IssueText).Returns(issue); m_controller.ConfirmSelection(); A.CallTo(() => m_view.ShowMessageBox(@"Invalid issue number")).MustHaveHappened(); A.CallTo(() => m_commitTempMessage.Write(null)).WithAnyArguments().MustNotHaveHappened(); A.CallTo(() => m_view.Close()).MustNotHaveHappened(); A.CallTo(() => m_lastIssue.Save(null)).MustNotHaveHappened(); }
public void ConfirmSelection() { int intIssue; if (!int.TryParse(m_view.IssueText, out intIssue)) { m_view.ShowMessageBox(@"Invalid issue number"); return; } m_commitTempMessage.Write($"[#{m_view.IssueText}] - {m_commitTempMessage.Read()}"); m_lastIssue.Save(m_view.IssueText); m_issueSelected = true; m_view.Close(); }