コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: FakeGit.cs プロジェクト: powercode/PSGitCompletions
 public FakeGitScope()
 {
     _scope          = new GitExecuterScope(Git.GitExecuter);
     Git.GitExecuter = Execute;
 }