Skip to content

Commit 5b408dd

Browse files
asbjornuJakeGinnivan
authored andcommitted
Removed mocking of IRepository since it's not being used by any of the tests anymore.
1 parent c2b0c34 commit 5b408dd

File tree

1 file changed

+1
-86
lines changed

1 file changed

+1
-86
lines changed
Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
11
using System;
22
using System.Collections.Generic;
33
using System.IO;
4-
using System.Linq;
54
using System.Text;
65

76
using GitVersion.Helpers;
87

98
using LibGit2Sharp;
109

11-
using NSubstitute;
12-
1310
public class TestFileSystem : IFileSystem
1411
{
1512
Dictionary<string, string> fileSystem = new Dictionary<string, string>();
@@ -95,88 +92,6 @@ public long GetLastDirectoryWrite(string path)
9592

9693
public IRepository GetRepository(string gitDirectory)
9794
{
98-
var repository = Substitute.For<IRepository>();
99-
var tip = Substitute.For<Commit>();
100-
tip.Committer.Returns(new Signature("Asbjørn Ulsberg", "[email protected]", new DateTimeOffset(2015, 11, 10, 13, 37, 0, TimeSpan.FromHours(1))));
101-
var commits = new Commits
102-
{
103-
tip
104-
};
105-
repository.Commits.QueryBy(null).ReturnsForAnyArgs(commits);
106-
var head = Substitute.For<Branch>();
107-
head.CanonicalName.Returns("refs/heads/master");
108-
tip.Sha.Returns("e7da1b19d03394896fb8da8916cd26f0efb1566f");
109-
head.Tip.Returns(tip);
110-
repository.Head.Returns(head);
111-
var branches = new Branches
112-
{
113-
{ "master", tip }
114-
};
115-
116-
repository.Branches.Returns(branches);
117-
return repository;
118-
}
119-
120-
121-
class Branches : BranchCollection
122-
{
123-
IList<Branch> branches;
124-
125-
126-
public Branches()
127-
{
128-
this.branches = new List<Branch>();
129-
}
130-
131-
132-
public override Branch this[string name]
133-
{
134-
get { return this.branches.FirstOrDefault(b => b.Name == name); }
135-
}
136-
137-
138-
public override Branch Add(string name, Commit commit, bool allowOverwrite = false)
139-
{
140-
var branch = Substitute.For<Branch>();
141-
branch.Name.Returns(name);
142-
branch.Tip.Returns(commit);
143-
this.branches.Add(branch);
144-
return branch;
145-
}
146-
147-
148-
public override Branch Add(string name, Commit commit, Signature signature, string logMessage = null, bool allowOverwrite = false)
149-
{
150-
return Add(name, commit, allowOverwrite);
151-
}
152-
153-
154-
public override IEnumerator<Branch> GetEnumerator()
155-
{
156-
return this.branches.GetEnumerator();
157-
}
158-
}
159-
160-
class Commits : List<Commit>, IQueryableCommitLog
161-
{
162-
public CommitSortStrategies SortedBy { get; private set; }
163-
164-
165-
public ICommitLog QueryBy(CommitFilter filter)
166-
{
167-
throw new NotImplementedException();
168-
}
169-
170-
171-
public Commit FindMergeBase(Commit first, Commit second)
172-
{
173-
throw new NotImplementedException();
174-
}
175-
176-
177-
public Commit FindMergeBase(IEnumerable<Commit> commits, MergeBaseFindingStrategy strategy)
178-
{
179-
throw new NotImplementedException();
180-
}
95+
throw new NotImplementedException();
18196
}
18297
}

0 commit comments

Comments
 (0)