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

Commit 9e37f36

Browse files
authored
Merge pull request #1997 from github/fixes/unit-tests
Various unit test fixes.
2 parents 6c1e811 + 3096dd8 commit 9e37f36

File tree

52 files changed

+577
-686
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+577
-686
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ProjectConfiguration>
2+
<Settings>
3+
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
4+
</Settings>
5+
</ProjectConfiguration>
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<ProjectConfiguration>
2+
<Settings>
3+
<CopyReferencedAssembliesToWorkspace>True</CopyReferencedAssembliesToWorkspace>
4+
</Settings>
5+
</ProjectConfiguration>

GitHubVS.v3.ncrunchsolution

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<AdditionalFilesToIncludeForSolution>
88
<Value>lib\**.*</Value>
99
</AdditionalFilesToIncludeForSolution>
10-
<AllowParallelTestExecution>False</AllowParallelTestExecution>
10+
<AllowParallelTestExecution>True</AllowParallelTestExecution>
1111
<ProjectConfigStoragePathRelativeToSolutionDir>.ncrunch</ProjectConfigStoragePathRelativeToSolutionDir>
1212
<SolutionConfigured>True</SolutionConfigured>
1313
</Settings>

src/GitHub.App/SampleData/PullRequestDetailViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public PullRequestDetailViewModelDesigner()
9696

9797
Files = new PullRequestFilesViewModelDesigner();
9898

99-
Checks = new PullRequestCheckViewModelDesigner[0];
99+
Checks = Array.Empty<PullRequestCheckViewModelDesigner>();
100100
}
101101

102102
public PullRequestDetailModel Model { get; }

src/GitHub.App/SampleData/PullRequestUserReviewsViewModelDesigner.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public PullRequestUserReviewsViewModelDesigner()
2727
{
2828
IsExpanded = true,
2929
HasDetails = true,
30-
FileComments = new IPullRequestReviewFileCommentViewModel[0],
30+
FileComments = Array.Empty<IPullRequestReviewFileCommentViewModel>(),
3131
StateDisplay = "approved",
3232
Model = new PullRequestReviewModel
3333
{

src/GitHub.App/Services/ModelService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ IObservable<IReadOnlyList<IRemoteRepositoryModel>> GetUserRepositories(Repositor
320320
log.Error(e,
321321
"Retrieving {RepositoryType} user repositories failed because user is not stored in the cache",
322322
repositoryType);
323-
return Observable.Return(new IRemoteRepositoryModel[] {});
323+
return Observable.Return(Array.Empty<IRemoteRepositoryModel>());
324324
});
325325
}
326326

@@ -355,7 +355,7 @@ IObservable<IReadOnlyList<IRemoteRepositoryModel>> GetOrganizationRepositories(s
355355
{
356356
log.Error(e, "Retrieveing {Organization} org repositories failed because user is not stored in the cache",
357357
organization);
358-
return Observable.Return(new IRemoteRepositoryModel[] {});
358+
return Observable.Return(Array.Empty<IRemoteRepositoryModel>());
359359
});
360360
}
361361

src/GitHub.App/Services/StandardUserErrors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public static IObservable<RecoveryOptionResult> ShowUserErrorThatRequiresNavigat
189189

190190
return exception.DisplayErrorMessage(
191191
errorType,
192-
new object[] { },
192+
Array.Empty<object>(),
193193
new[] { OpenBrowser("View Plans", account.Billing()), Cancel });
194194
}
195195

src/GitHub.App/ViewModels/Dialog/RepositoryCreationViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public async Task InitializeAsync(IConnection connection)
182182

183183
accounts = modelService.GetAccounts()
184184
.ObserveOn(RxApp.MainThreadScheduler)
185-
.ToProperty(this, vm => vm.Accounts, initialValue: new ReadOnlyCollection<IAccount>(new IAccount[] { }));
185+
.ToProperty(this, vm => vm.Accounts, initialValue: new ReadOnlyCollection<IAccount>(Array.Empty<IAccount>()));
186186

187187
this.WhenAny(x => x.Accounts, x => x.Value)
188188
.Select(accts => accts?.FirstOrDefault())

src/GitHub.App/ViewModels/GitHubPane/PullRequestCheckViewModel.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor
5151
pullRequestCheckViewModel.DetailsUrl = !string.IsNullOrEmpty(model.TargetUrl) ? new Uri(model.TargetUrl) : null;
5252

5353
return pullRequestCheckViewModel;
54-
}) ?? new PullRequestCheckViewModel[0];
54+
}) ?? Array.Empty<PullRequestCheckViewModel>();
5555

5656
var checks = pullRequest.CheckSuites?.SelectMany(model => model.CheckRuns)
5757
.Select(model =>
@@ -97,7 +97,7 @@ public static IEnumerable<IPullRequestCheckViewModel> Build(IViewViewModelFactor
9797
pullRequestCheckViewModel.DetailsUrl = new Uri(model.DetailsUrl);
9898

9999
return pullRequestCheckViewModel;
100-
}) ?? new PullRequestCheckViewModel[0];
100+
}) ?? Array.Empty<PullRequestCheckViewModel>();
101101

102102
return statuses.Concat(checks).OrderBy(model => model.Title);
103103
}

src/GitHub.App/ViewModels/TeamExplorer/RepositoryPublishViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public RepositoryPublishViewModel(
7272
.SelectMany(async c => (await modelServiceFactory.CreateAsync(c)).GetAccounts())
7373
.Switch()
7474
.ObserveOn(RxApp.MainThreadScheduler)
75-
.ToProperty(this, x => x.Accounts, initialValue: new ReadOnlyCollection<IAccount>(new IAccount[] {}));
75+
.ToProperty(this, x => x.Accounts, initialValue: new ReadOnlyCollection<IAccount>(Array.Empty<IAccount>()));
7676

7777
this.WhenAny(x => x.Accounts, x => x.Value)
7878
.WhereNotNull()

0 commit comments

Comments
 (0)