public void CanCompleteGetGitFetchRemoteRef() { using var scope = new GitExecuterScope(executer: Git.GitExecuter); Git.GitExecuter = GetGitRemoteRefs; var completions = "git fetch origin".CompleteInput(); Assert.Equal(3, actual: completions.Count); Assert.Equal("ForEach", actual: completions[0].CompletionText); }
public void CanCompleteGetGitFetchRemote() { using var scope = new GitExecuterScope(executer: Git.GitExecuter); Git.GitExecuter = GetGitRemoteRefs; var completions = "git fetch ".CompleteInput(); Assert.Equal(2, actual: completions.Count); Assert.Equal("upstream", actual: completions[1].CompletionText); }
public void CanCompleteGitDiffOptions() { using var scope = new GitExecuterScope(executer: Git.GitExecuter); Git.GitExecuter = GetGitLog; var res = "git diff ".CompleteInput(); Assert.Equal("afcff36f", actual: res[0].CompletionText); Assert.Equal("Moving CurrentTypeDefinitionAst to TypeInferenceContext", actual: res[4].ToolTip); }
public void CanGetGitRemoteRefs() { using var scope = new GitExecuterScope(executer: Git.GitExecuter); Git.GitExecuter = GetGitRemoteRefs; var remoteRefs = Git.RemoteRefs().ToArray(); Assert.Equal("ForEach", actual: remoteRefs[0].Ref); Assert.Equal("fea270412167ad3e4e5a5297642dcb7d5f9c51ee", actual: remoteRefs[2].Commit); Assert.Equal("origin", actual: remoteRefs[1].Remote); Assert.Equal("origin/ext-method", actual: remoteRefs[2].RemoteRef); }
public FakeGitScope() { _scope = new GitExecuterScope(Git.GitExecuter); Git.GitExecuter = Execute; }