Пример #1
0
        public void InitializeRepository_WhenRepositoryIsInitialized_ShouldDoNothing()
        {
            A.CallTo(() => m_repository.IsArmed).Returns(true);

            m_controller.InitializeRepository();

            A.CallTo(() => m_repository.Arm()).MustNotHaveHappened();
        }
Пример #2
0
        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");
            }
        }