public void InitializeRepository_WhenRepositoryIsInitialized_ShouldDoNothing() { A.CallTo(() => m_repository.IsArmed).Returns(true); m_controller.InitializeRepository(); A.CallTo(() => m_repository.Arm()).MustNotHaveHappened(); }
public void InitializeRepository() { try { if (m_repository.IsArmed) { return; } m_repository.Arm(); m_view.SetRepositoryStatus(true); } catch (HooksAlreadyExistsException e) { m_logger.Error(e); m_view.ShowMessageBox("This repository cannot be armed because git hooks are already defined"); } catch (Exception e) { m_logger.Error(e); m_view.ShowMessageBox("An error has occurred arming repository"); } }