Skip to content

Commit 42e76b3

Browse files
Fix integration tests
1 parent 9ffea68 commit 42e76b3

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

src/Squirrel/UpdateManager.ApplyReleases.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,8 @@ async Task<ReleaseEntry> createFullPackagesFromDeltas(IEnumerable<ReleaseEntry>
323323
{
324324
Contract.Requires(releasesToApply != null);
325325

326+
progress = progress ?? new ApplyReleasesProgress(releasesToApply.Count(), x => { });
327+
326328
// If there are no remote releases at all, bail
327329
if (!releasesToApply.Any()) {
328330
return null;

test/ApplyReleasesProgressTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public class ApplyReleasesProgressTests
1111
{
1212

1313
[Fact]
14-
public void CalculatesPercentageCorrectly()
14+
public async void CalculatesPercentageCorrectly()
1515
{
1616
// Just 1 complex situation should be enough to cover this
1717

@@ -25,6 +25,9 @@ public void CalculatesPercentageCorrectly()
2525
// Report 40 % in current release
2626
progress.ReportReleaseProgress(50);
2727

28+
// Required for callback to be invoked
29+
await Task.Delay(50);
30+
2831
// 20 per release
2932
// 10 because we are half-way the 3rd release
3033
var expectedProgress = 20 + 20 + 10;

test/ApplyReleasesTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ public async Task CreateFullPackagesFromDeltaSmokeTest()
437437
var deltaEntry = ReleaseEntry.GenerateFromFile(Path.Combine(tempDir, "theApp", "packages", "Squirrel.Core.1.1.0.0-delta.nupkg"));
438438

439439
var resultObs = (Task<ReleaseEntry>)fixture.GetType().GetMethod("createFullPackagesFromDeltas", BindingFlags.NonPublic | BindingFlags.Instance)
440-
.Invoke(fixture, new object[] { new[] {deltaEntry}, baseEntry });
440+
.Invoke(fixture, new object[] { new[] {deltaEntry}, baseEntry, null });
441441

442442
var result = await resultObs;
443443
var zp = new ZipPackage(Path.Combine(tempDir, "theApp", "packages", result.Filename));

0 commit comments

Comments
 (0)