Skip to content

Commit 9ee340f

Browse files
yorahnulltoken
authored andcommitted
Make Remote mockable
1 parent b6274a1 commit 9ee340f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

LibGit2Sharp/Remote.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ public class Remote : IEquatable<Remote>
1212
private static readonly LambdaEqualityHelper<Remote> equalityHelper =
1313
new LambdaEqualityHelper<Remote>(new Func<Remote, object>[] { x => x.Name, x => x.Url });
1414

15+
/// <summary>
16+
/// Needed for mocking purposes.
17+
/// </summary>
18+
protected Remote()
19+
{ }
20+
1521
internal static Remote CreateFromPtr(RemoteSafeHandle handle)
1622
{
1723
if (handle == null)
@@ -34,12 +40,12 @@ internal static Remote CreateFromPtr(RemoteSafeHandle handle)
3440
/// <summary>
3541
/// Gets the alias of this remote repository.
3642
/// </summary>
37-
public string Name { get; private set; }
43+
public virtual string Name { get; private set; }
3844

3945
/// <summary>
4046
/// Gets the url to use to communicate with this remote repository.
4147
/// </summary>
42-
public string Url { get; private set; }
48+
public virtual string Url { get; private set; }
4349

4450
/// <summary>
4551
/// Determines whether the specified <see cref = "Object" /> is equal to the current <see cref = "Remote" />.

0 commit comments

Comments
 (0)