Example #1
0
        public void ShouldNotSucceedAndReturnConflicts()
        {
            _mergeResult.Conflicts.ForEach((c, i) =>
            {
                var targetBlob  = Repo.Lookup <Blob>(new ObjectId(c.TargetSha));
                var targetValue = targetBlob.GetContentText();
                var value       = i + 1;

                c.SourceSha.Should().BeNull();
                targetValue.Should().Be(MapToDocumentValue(value, true));

                c.TargetSha = null;
            });

            _mergeResult.ShouldBeEquivalentTo(new MergeInfo
            {
                Message      = "Could not merge test into master because of conflicts. Please merge manually",
                SourceBranch = "test",
                TargetBranch = "master",
                Status       = MergeResult.Conflicts,
                Conflicts    = Enumerable.Range(1, 2).Select(i => new ConflictInfo {
                    Type = ConflictType.Remove, Path = $"file\\key {i}"
                }).ToList()
            });
        }
Example #2
0
 public void FirstMergesShouldSuccedWithValidInfo() =>
 _firstMergeResult.ShouldBeEquivalentTo(MergeInfo.Succeeded("test2", "master", _commitBeforeSecondMerge));
Example #3
0
 public void MergeShouldSuccedWithValidInfo() =>
 _mergeResult.ShouldBeEquivalentTo(MergeInfo.Succeeded("test", "master", string.Empty));