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

Commit 91de84e

Browse files
committed
Fix tests
1 parent 434d620 commit 91de84e

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

test/TrackingCollectionTests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@
3636
[assembly: AssemblyVersion("1.0.0.0")]
3737
[assembly: AssemblyFileVersion("1.0.0.0")]
3838

39-
[assembly: Timeout(2000)]
39+
[assembly: Timeout(2 /*minutes*/ *60*1000)]

test/UnitTests/GitHub.App/ViewModels/Dialog/RepositoryCloneViewModelTests.cs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
using GitHub.Factories;
1515
using GitHub.Primitives;
1616
using GitHub.ViewModels.Dialog;
17+
using System.Diagnostics;
1718

1819
public class RepositoryCloneViewModelTests
1920
{
@@ -104,14 +105,14 @@ public async Task StartsTrueBecomesFalseWhenCompleted()
104105
repoSubject.OnNext(Substitute.For<IRemoteRepositoryModel>());
105106
repoSubject.OnNext(Substitute.For<IRemoteRepositoryModel>());
106107

107-
await done.Timeout(TimeSpan.FromMilliseconds(500));
108+
await done.Timeout(TimeSpan.FromMilliseconds(Timeout));
108109
done = null;
109110

110111
Assert.True(vm.IsBusy);
111112

112113
repoSubject.OnCompleted();
113114

114-
await col.OriginalCompleted.Timeout(TimeSpan.FromMilliseconds(Timeout));;
115+
await col.OriginalCompleted.Timeout(TimeSpan.FromMilliseconds(Timeout));
115116

116117
// we need to wait slightly because the subscription OnComplete in the model
117118
// runs right after the above await finishes, which means the assert
@@ -211,7 +212,7 @@ public void IsFalseWhenFailed()
211212
}
212213

213214
[Test]
214-
public void IsTrueWhenLoadingCompleteNotFailedAndNoRepositories()
215+
public async Task IsTrueWhenLoadingCompleteNotFailedAndNoRepositories()
215216
{
216217
var repoSubject = new Subject<IRemoteRepositoryModel>();
217218
var modelService = Substitute.For<IModelService>();
@@ -226,6 +227,9 @@ public void IsTrueWhenLoadingCompleteNotFailedAndNoRepositories()
226227

227228
repoSubject.OnCompleted();
228229

230+
// we need to delay slightly because the subscribers listening for OnComplete
231+
// need to run before the assert is checked
232+
await Task.Delay(100);
229233
Assert.True(vm.NoRepositoriesFound);
230234
}
231235
}
@@ -273,7 +277,7 @@ public void IsFalseIfLoadingReposFails()
273277
}
274278

275279
[Test]
276-
public void IsFalseWhenLoadingCompleteNotFailedAndNoRepositories()
280+
public async Task IsFalseWhenLoadingCompleteNotFailedAndNoRepositories()
277281
{
278282
var repoSubject = new Subject<IRemoteRepositoryModel>();
279283
var modelService = Substitute.For<IModelService>();
@@ -288,6 +292,9 @@ public void IsFalseWhenLoadingCompleteNotFailedAndNoRepositories()
288292

289293
repoSubject.OnCompleted();
290294

295+
// we need to delay slightly because the subscribers listening for OnComplete
296+
// need to run before the assert is checked
297+
await Task.Delay(100);
291298
Assert.False(vm.FilterTextIsEnabled);
292299
}
293300
}

test/UnitTests/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
// The following GUID is for the ID of the typelib if this project is exposed to COM
1313
[assembly: Guid("7c0cb7e5-6c7b-4f11-8454-9e1a4747641c")]
1414

15-
[assembly: Timeout(2000)]
15+
[assembly: Timeout(2 /*minutes*/ *60*1000)]

0 commit comments

Comments
 (0)