Esempio n. 1
0
        public void OnEnableVersionControl_WithRepoNoProjectId_InitializesRepository()
        {
            TestableGitProxy             gitProxy             = new TestableGitProxy();
            TestableCollabVersionControl collabVersionControl = new TestableCollabVersionControl(gitProxy);

            collabVersionControl.OnEnableVersionControl();
            Assert.That(gitProxy.InitializeRepositoryCount == 1);
        }
        public void JsProxyClient_WhenJobRunningCalled_ReturnsVersionControlIsJobRunning(bool jobIsRunning)
        {
            TestableGitProxy             gitProxy = new TestableGitProxy();
            TestableCollabVersionControl collabVersionControlMock = new TestableCollabVersionControl(gitProxy);

            collabVersionControlMock.IsJobRunningReturn = jobIsRunning;
            JsProxyClient jpc = new JsProxyClient(collabVersionControlMock);

            Assert.AreEqual(jobIsRunning, jpc.IsJobRunning());
        }
Esempio n. 3
0
        public void OnEnableVersionControl_WithRepoNoProjectId_DoesNotSetRemoteOrigin()
        {
            TestableGitProxy gitProxy = new TestableGitProxy();

            gitProxy.RepositoryExistsReturn = true;
            TestableCollabVersionControl collabVersionControl = new TestableCollabVersionControl(gitProxy);

            collabVersionControl.OnEnableVersionControl();
            Assert.That(gitProxy.SetRemoteOriginCount == 0);
        }
Esempio n. 4
0
        public void OnEnableVersionControl_WithNoRepoWithProjectId_SetsCurrentHead()
        {
            TestableGitProxy gitProxy = new TestableGitProxy();

            gitProxy.RepositoryExistsReturn = false;
            TestableCollabVersionControl collabVersionControl = new TestableCollabVersionControl(gitProxy);

            collabVersionControl.ProjectId = "anything";
            collabVersionControl.BaseUrl   = "https://bestsiteever.com";
            collabVersionControl.OnEnableVersionControl();
            Assert.That(gitProxy.SetRemoteOriginCount == 1);
        }
Esempio n. 5
0
        public void OnEnableVersionControl_WithNoRepoWithProjectId_CallsOnFileSystemChanged()
        {
            TestableGitProxy gitProxy = new TestableGitProxy();

            gitProxy.RepositoryExistsReturn = false;
            TestableCollabVersionControl collabVersionControl = new TestableCollabVersionControl(gitProxy);

            collabVersionControl.ProjectId = "anything";
            collabVersionControl.BaseUrl   = "http://bestsiteever.com";
            collabVersionControl.OnEnableVersionControl();
            Assert.AreEqual(true, collabVersionControl.OnFileSystemChangedCalled);
        }