@@ -14,6 +14,12 @@ public class RemoteCollection : IEnumerable<Remote>
14
14
{
15
15
private readonly Repository repository ;
16
16
17
+ /// <summary>
18
+ /// Needed for mocking purposes.
19
+ /// </summary>
20
+ protected RemoteCollection ( )
21
+ { }
22
+
17
23
internal RemoteCollection ( Repository repository )
18
24
{
19
25
this . repository = repository ;
@@ -24,7 +30,7 @@ internal RemoteCollection(Repository repository)
24
30
/// </summary>
25
31
/// <param name = "name">The name of the remote to retrieve.</param>
26
32
/// <returns>The retrived <see cref = "Remote" /> if it has been found, null otherwise.</returns>
27
- public Remote this [ string name ]
33
+ public virtual Remote this [ string name ]
28
34
{
29
35
get { return RemoteForName ( name ) ; }
30
36
}
@@ -57,7 +63,7 @@ private Remote RemoteForName(string name)
57
63
/// Returns an enumerator that iterates through the collection.
58
64
/// </summary>
59
65
/// <returns>An <see cref = "IEnumerator{T}" /> object that can be used to iterate through the collection.</returns>
60
- public IEnumerator < Remote > GetEnumerator ( )
66
+ public virtual IEnumerator < Remote > GetEnumerator ( )
61
67
{
62
68
return Libgit2UnsafeHelper
63
69
. ListAllRemoteNames ( repository . Handle )
@@ -83,7 +89,7 @@ IEnumerator IEnumerable.GetEnumerator()
83
89
/// <param name = "name">The name of the remote to create.</param>
84
90
/// <param name = "url">The location of the repository.</param>
85
91
/// <returns>A new <see cref = "Remote" />.</returns>
86
- public Remote Add ( string name , string url )
92
+ public virtual Remote Add ( string name , string url )
87
93
{
88
94
string fetchRefSpec = string . Format ( "+refs/heads/*:refs/remotes/{0}/*" , name ) ;
89
95
@@ -112,7 +118,7 @@ public Remote Create(string name, string url)
112
118
/// <param name = "url">The location of the repository.</param>
113
119
/// <param name = "fetchRefSpec">The refSpec to be used when fetching from this remote..</param>
114
120
/// <returns>A new <see cref = "Remote" />.</returns>
115
- public Remote Add ( string name , string url , string fetchRefSpec )
121
+ public virtual Remote Add ( string name , string url , string fetchRefSpec )
116
122
{
117
123
Ensure . ArgumentNotNull ( name , "name" ) ;
118
124
Ensure . ArgumentNotNull ( url , "url" ) ;
0 commit comments