コード例 #1
0
 public void TagPassesToRepo(
     [Frozen] IGitRepository repo,
     string target,
     GetRepoTarget sut)
 {
     sut.Get(repo, new GitPatcherVersioning(PatcherVersioningEnum.Tag, target));
     repo.Received(1).TryGetTagSha(target, out Arg.Any <string?>());
 }
コード例 #2
0
 public void TagTargetFetches(
     [Frozen] IGitRepository repo,
     string target,
     GetRepoTarget sut)
 {
     sut.Get(repo, new GitPatcherVersioning(PatcherVersioningEnum.Tag, target));
     repo.Received(1).Fetch();
 }
コード例 #3
0
 public void PassesShaToTryGetCommit(
     [Frozen] IGitRepository repo,
     RepoTarget targets,
     GitPatcherVersioning patcherVersioning,
     CancellationToken cancel,
     RetrieveCommit sut)
 {
     sut.TryGet(repo, targets, patcherVersioning, cancel);
     repo.Received(1).TryGetCommit(targets.TargetSha, out Arg.Any <bool>());
 }
コード例 #4
0
        public void ChecksOutMainBranch(
            IGitRepository repo,
            ResetToLatestMain sut)
        {
            var branch = Substitute.For <IBranch>();

            repo.MainBranch.Returns(branch);
            sut.TryReset(repo);
            repo.Received(1).Checkout(branch);
        }