Ejemplo 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());
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }