Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit a41dbc1

Browse files
committed
Use IReadOnlyList and keep IVSGitExt consistent with IGitExt
There's now no reason not to return a IReadOnlyList like IGitExt.ActiveRepositories.
1 parent 7ea9d81 commit a41dbc1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

src/GitHub.Exports/Services/IVSGitExt.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace GitHub.Services
66
{
77
public interface IVSGitExt
88
{
9-
IEnumerable<ILocalRepositoryModel> ActiveRepositories { get; }
9+
IReadOnlyList<ILocalRepositoryModel> ActiveRepositories { get; }
1010
event Action ActiveRepositoriesChanged;
1111
}
1212
}

src/GitHub.TeamFoundation.14/Services/VSGitExt.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class VSGitExt : IVSGitExt
2525
readonly ILocalRepositoryModelFactory repositoryFactory;
2626

2727
IGitExt gitService;
28-
IEnumerable<ILocalRepositoryModel> activeRepositories;
28+
IReadOnlyList<ILocalRepositoryModel> activeRepositories;
2929

3030
[ImportingConstructor]
3131
public VSGitExt(IGitHubServiceProvider serviceProvider, IVSUIContextFactory factory, ILocalRepositoryModelFactory repositoryFactory)
@@ -101,7 +101,7 @@ void RefreshActiveRepositories()
101101
}
102102
}
103103

104-
public IEnumerable<ILocalRepositoryModel> ActiveRepositories
104+
public IReadOnlyList<ILocalRepositoryModel> ActiveRepositories
105105
{
106106
get
107107
{

test/UnitTests/GitHub.TeamFoundation/VSGitExtTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public void SccProviderContextIsActive_InitializeWithActiveRepositories()
152152

153153
var activeRepositories = target.ActiveRepositories;
154154

155-
Assert.That(activeRepositories.Count(), Is.EqualTo(1));
155+
Assert.That(activeRepositories.Count, Is.EqualTo(1));
156156
repoFactory.Received(1).Create(repoPath);
157157
}
158158

@@ -170,7 +170,7 @@ public void ExceptionRefreshingRepositories_ReturnsEmptyList()
170170
var activeRepositories = target.ActiveRepositories;
171171

172172
repoFactory.Received(1).Create(repoPath);
173-
Assert.That(activeRepositories.Count(), Is.EqualTo(0));
173+
Assert.That(activeRepositories.Count, Is.EqualTo(0));
174174
}
175175
}
176176

0 commit comments

Comments
 (0)