Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryorah <yoram.harmelin@gmail.com>2012-06-17 01:51:39 +0400
committernulltoken <emeric.fermas@gmail.com>2012-06-19 00:02:30 +0400
commit595a3ca00ebe65548f65c126a62c6c4487ebdaff (patch)
tree6fd1ef2e7995a54cbc92a78efd93c1d017a1911e /LibGit2Sharp/RepositoryInformation.cs
parent1040c5ea79b9f793276b0bdb434336017e2aa2d9 (diff)
Make RepositoryInformation mockable
Diffstat (limited to 'LibGit2Sharp/RepositoryInformation.cs')
-rw-r--r--LibGit2Sharp/RepositoryInformation.cs18
1 files changed, 12 insertions, 6 deletions
diff --git a/LibGit2Sharp/RepositoryInformation.cs b/LibGit2Sharp/RepositoryInformation.cs
index 3f24c286..b371eb9a 100644
--- a/LibGit2Sharp/RepositoryInformation.cs
+++ b/LibGit2Sharp/RepositoryInformation.cs
@@ -9,6 +9,12 @@ namespace LibGit2Sharp
{
private readonly Repository repo;
+ /// <summary>
+ /// Needed for mocking purposes.
+ /// </summary>
+ protected RepositoryInformation()
+ { }
+
internal RepositoryInformation(Repository repo, bool isBare)
{
this.repo = repo;
@@ -24,7 +30,7 @@ namespace LibGit2Sharp
/// <summary>
/// Gets the normalized path to the git repository.
/// </summary>
- public string Path { get; private set; }
+ public virtual string Path { get; private set; }
/// <summary>
/// Gets the normalized path to the working directory.
@@ -32,12 +38,12 @@ namespace LibGit2Sharp
/// Is the repository is bare, null is returned.
/// </para>
/// </summary>
- public string WorkingDirectory { get; private set; }
+ public virtual string WorkingDirectory { get; private set; }
/// <summary>
/// Indicates whether the repository has a working directory.
/// </summary>
- public bool IsBare { get; private set; }
+ public virtual bool IsBare { get; private set; }
/// <summary>
/// Gets a value indicating whether this repository is empty.
@@ -45,7 +51,7 @@ namespace LibGit2Sharp
/// <value>
/// <c>true</c> if this repository is empty; otherwise, <c>false</c>.
/// </value>
- public bool IsEmpty
+ public virtual bool IsEmpty
{
get { return NativeMethods.RepositoryStateChecker(repo.Handle, NativeMethods.git_repository_is_empty); }
}
@@ -53,7 +59,7 @@ namespace LibGit2Sharp
/// <summary>
/// Indicates whether the Head points to an arbitrary commit instead of the tip of a local branch.
/// </summary>
- public bool IsHeadDetached
+ public virtual bool IsHeadDetached
{
get { return NativeMethods.RepositoryStateChecker(repo.Handle, NativeMethods.git_repository_head_detached); }
}
@@ -61,7 +67,7 @@ namespace LibGit2Sharp
/// <summary>
/// Indicates whether the Head points to a reference which doesn't exist.
/// </summary>
- public bool IsHeadOrphaned
+ public virtual bool IsHeadOrphaned
{
get { return NativeMethods.RepositoryStateChecker(repo.Handle, NativeMethods.git_repository_head_orphan); }
}