Skip to content

Commit d617a59

Browse files
committed
cleanup
1 parent 26a89e5 commit d617a59

9 files changed

+8
-165
lines changed

src/GitVersionCore.Tests/Core/RepositoryExtensionsTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public void EnsureLocalBranchExistsForCurrentBranch_CaseInsensitivelyMatchesBran
7676
EnsureLocalBranchExistsForCurrentBranch(repository, log, remote, "refs/heads/featurE/feat-test");
7777
}
7878

79-
private IGitRepository MockRepository()
79+
private static IGitRepository MockRepository()
8080
{
8181
var repository = Substitute.For<IGitRepository>();
8282
var commands = Substitute.For<IGitRepositoryCommands>();

src/GitVersionCore.Tests/Mocks/MockBranchCollection.cs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,23 +23,5 @@ public void Add(Branch item)
2323
{
2424
Branches.Add(item);
2525
}
26-
27-
public void Clear()
28-
{
29-
Branches.Clear();
30-
}
31-
32-
public bool Contains(Branch item)
33-
{
34-
return Branches.Contains(item);
35-
}
36-
37-
public void CopyTo(Branch[] array, int arrayIndex)
38-
{
39-
Branches.CopyTo(array, arrayIndex);
40-
}
41-
42-
public int Count => Branches.Count;
43-
public bool IsReadOnly => false;
4426
}
4527
}

src/GitVersionCore.Tests/Mocks/MockCommitLog.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55

66
namespace GitVersionCore.Tests.Mocks
77
{
8-
public class MockCommitLog : ICommitLog, ICollection<Commit>
8+
public class MockCommitLog : ICommitLog
99
{
10-
public List<Commit> Commits = new List<Commit>();
10+
private List<Commit> Commits = new List<Commit>();
1111

1212
public IEnumerator<Commit> GetEnumerator()
1313
{

src/GitVersionCore.Tests/Mocks/MockMergeCommit.cs

Lines changed: 0 additions & 12 deletions
This file was deleted.

src/GitVersionCore.Tests/Mocks/MockQueryableCommitLog.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,6 @@ public IEnumerable<LogEntry> QueryBy(string path)
3636
throw new NotImplementedException();
3737
}
3838

39-
public Commit FindMergeBase(Commit first, Commit second)
40-
{
41-
return null;
42-
}
43-
44-
public Commit FindMergeBase(IEnumerable<Commit> commits, MergeBaseFindingStrategy strategy)
45-
{
46-
throw new NotImplementedException();
47-
}
48-
4939
public IEnumerable<LogEntry> QueryBy(string path, CommitFilter filter)
5040
{
5141
throw new NotImplementedException();
Lines changed: 2 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
using System.Collections;
21
using System.Collections.Generic;
32
using LibGit2Sharp;
43

54
namespace GitVersionCore.Tests.Mocks
65
{
7-
public class MockReferenceCollection : ReferenceCollection, ICollection<Commit>
6+
public class MockReferenceCollection : ReferenceCollection
87
{
9-
108
public override ReflogCollection Log(string canonicalName)
119
{
1210
return new MockReflogCollection
@@ -15,45 +13,16 @@ public override ReflogCollection Log(string canonicalName)
1513
};
1614
}
1715

18-
public List<Commit> Commits = new List<Commit>();
16+
private List<Commit> Commits = new List<Commit>();
1917

2018
public new IEnumerator<Commit> GetEnumerator()
2119
{
2220
return Commits.GetEnumerator();
2321
}
2422

25-
IEnumerator IEnumerable.GetEnumerator()
26-
{
27-
return GetEnumerator();
28-
}
29-
3023
public void Add(Commit item)
3124
{
3225
Commits.Add(item);
3326
}
34-
35-
public void Clear()
36-
{
37-
Commits.Clear();
38-
}
39-
40-
public bool Contains(Commit item)
41-
{
42-
return Commits.Contains(item);
43-
}
44-
45-
public void CopyTo(Commit[] array, int arrayIndex)
46-
{
47-
Commits.CopyTo(array, arrayIndex);
48-
}
49-
50-
public bool Remove(Commit item)
51-
{
52-
return Commits.Remove(item);
53-
}
54-
55-
public int Count => Commits.Count;
56-
57-
public bool IsReadOnly => false;
5827
}
5928
}
Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,19 @@
1-
using System.Collections;
21
using System.Collections.Generic;
32
using LibGit2Sharp;
43

54
namespace GitVersionCore.Tests.Mocks
65
{
7-
public class MockReflogCollection : ReflogCollection, ICollection<Commit>
6+
public class MockReflogCollection : ReflogCollection
87
{
98
public List<Commit> Commits = new List<Commit>();
10-
119
public new IEnumerator<Commit> GetEnumerator()
1210
{
1311
return Commits.GetEnumerator();
1412
}
1513

16-
IEnumerator IEnumerable.GetEnumerator()
17-
{
18-
return GetEnumerator();
19-
}
20-
2114
public void Add(Commit item)
2215
{
2316
Commits.Add(item);
2417
}
25-
26-
public void Clear()
27-
{
28-
Commits.Clear();
29-
}
30-
31-
public bool Contains(Commit item)
32-
{
33-
return Commits.Contains(item);
34-
}
35-
36-
public void CopyTo(Commit[] array, int arrayIndex)
37-
{
38-
Commits.CopyTo(array, arrayIndex);
39-
}
40-
41-
public bool Remove(Commit item)
42-
{
43-
return Commits.Remove(item);
44-
}
45-
46-
public int Count => Commits.Count;
47-
48-
public bool IsReadOnly => false;
4918
}
5019
}

src/GitVersionCore.Tests/Mocks/MockTagAnnotation.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 2 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,18 @@
1-
using System.Collections;
21
using System.Collections.Generic;
32
using LibGit2Sharp;
43

54
namespace GitVersionCore.Tests.Mocks
65
{
7-
public class MockTagCollection : TagCollection, ICollection<Tag>
6+
public class MockTagCollection : TagCollection
87
{
9-
10-
public List<Tag> Tags = new List<Tag>();
8+
private List<Tag> Tags = new List<Tag>();
119
public override IEnumerator<Tag> GetEnumerator()
1210
{
1311
return Tags.GetEnumerator();
1412
}
15-
16-
IEnumerator<Tag> IEnumerable<Tag>.GetEnumerator()
17-
{
18-
return GetEnumerator();
19-
}
20-
21-
IEnumerator IEnumerable.GetEnumerator()
22-
{
23-
return GetEnumerator();
24-
}
25-
2613
public void Add(Tag item)
2714
{
2815
Tags.Add(item);
2916
}
30-
31-
public void Clear()
32-
{
33-
Tags.Clear();
34-
}
35-
36-
public bool Contains(Tag item)
37-
{
38-
return Tags.Contains(item);
39-
}
40-
41-
public void CopyTo(Tag[] array, int arrayIndex)
42-
{
43-
Tags.CopyTo(array, arrayIndex);
44-
}
45-
46-
public override void Remove(Tag tag)
47-
{
48-
Tags.Remove(tag);
49-
}
50-
51-
bool ICollection<Tag>.Remove(Tag item)
52-
{
53-
return Tags.Remove(item);
54-
}
55-
56-
public int Count => Tags.Count;
57-
public bool IsReadOnly => false;
5817
}
5918
}

0 commit comments

Comments
 (0)