Skip to content
This repository has been archived by the owner on Jul 30, 2024. It is now read-only.
/ NuGet.Jobs Public archive

Commit

Permalink
Add missing test DLLs to test.ps1 and fix two UTs (#780)
Browse files Browse the repository at this point in the history
  • Loading branch information
joelverhagen committed Jul 23, 2019
1 parent d9c4d46 commit c206163
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 5 deletions.
9 changes: 7 additions & 2 deletions test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,22 @@ Function Run-Tests {

$xUnitExe = (Join-Path $PSScriptRoot "packages\xunit.runner.console\tools\xunit.console.exe")

$TestAssemblies = "tests\Monitoring.RebootSearchInstance.Tests\bin\$Configuration\NuGet.Monitoring.RebootSearchInstance.Tests.dll", `
$TestAssemblies = `
"tests\Monitoring.PackageLag.Tests\bin\$Configuration\Monitoring.PackageLag.Tests.dll", `
"tests\Monitoring.RebootSearchInstance.Tests\bin\$Configuration\NuGet.Monitoring.RebootSearchInstance.Tests.dll", `
"tests\NuGet.Jobs.Common.Tests\bin\$Configuration\NuGet.Jobs.Common.Tests.dll", `
"tests\NuGet.Jobs.GitHubIndexer.Tests\bin\$Configuration\NuGet.Jobs.GitHubIndexer.Tests.dll", `
"tests\NuGet.Services.Revalidate.Tests\bin\$Configuration\NuGet.Services.Revalidate.Tests.dll", `
"tests\NuGet.Services.Validation.Orchestrator.Tests\bin\$Configuration\NuGet.Services.Validation.Orchestrator.Tests.dll", `
"tests\StatusAggregator\bin\$Configuration\StatusAggregator.dll", `
"tests\Tests.CredentialExpiration\bin\$Configuration\Tests.CredentialExpiration.dll", `
"tests\Tests.Gallery.Maintenance\bin\$Configuration\Tests.Gallery.Maintenance.dll", `
"tests\Tests.Search.GenerateAuxiliaryData\bin\$Configuration\Tests.Search.GenerateAuxiliaryData.dll", `
"tests\Tests.Stats.AggregateCdnDownloadsInGallery\bin\$Configuration\Tests.Stats.AggregateCdnDownloadsInGallery.dll", `
"tests\Tests.Stats.AzureCdnLogs.Common\bin\$Configuration\Tests.Stats.AzureCdnLogs.Common.dll", `
"tests\Tests.Stats.CDNLogsSanitizer\bin\$Configuration\Tests.Stats.CDNLogsSanitizer.dll", `
"tests\Tests.Stats.CollectAzureCdnLogs\bin\$Configuration\Tests.Stats.CollectAzureCdnLogs.dll", `
"tests\Tests.Stats.CollectAzureChinaCdnLogs\bin\$Configuration\Tests.Stats.CollectAzureChinaCdnLogs.dll", `
"tests\Tests.Stats.CollectAzureChinaCDNLogs\bin\$Configuration\Tests.Stats.CollectAzureChinaCDNLogs.dll", `
"tests\Tests.Stats.ImportAzureCdnStatistics\bin\$Configuration\Tests.Stats.ImportAzureCdnStatistics.dll", `
"tests\Validation.Common.Job.Tests\bin\$Configuration\Validation.Common.Job.Tests.dll", `
"tests\Validation.PackageSigning.Core.Tests\bin\$Configuration\Validation.PackageSigning.Core.Tests.dll", `
Expand Down
18 changes: 15 additions & 3 deletions tests/Tests.Stats.AzureCdnLogs.Common/AzureBlobLockResultTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,23 @@ public class AzureBlobLockResultTests
[Fact]
public void ConstructorNullArgumentsTest()
{
Assert.Throws<ArgumentNullException>(() => new AzureBlobLockResult(blob: null, lockIsTaken: false,leaseId: string.Empty, linkToken: CancellationToken.None));
Assert.Throws<ArgumentNullException>(() => new AzureBlobLockResult(
blob: null,
lockIsTaken: false,
leaseId: string.Empty,
linkToken: CancellationToken.None));
}

[Fact]
public void VerifyThatTheTokenRespectsExternalCancellation()
{
// Arrange
var cts = new CancellationTokenSource();
var testAzureBlobLockResult = new AzureBlobLockResult(blob: new CloudBlob(new Uri("https://test")), lockIsTaken: false, leaseId: string.Empty, linkToken: cts.Token);
var testAzureBlobLockResult = new AzureBlobLockResult(
blob: new CloudBlob(new Uri("https://test/container")),
lockIsTaken: false,
leaseId: string.Empty,
linkToken: cts.Token);

// Act
cts.Cancel();
Expand All @@ -38,7 +46,11 @@ public void VerifyThatTheTokenCancellationDoesNotAffectExternalLinkedToken()
// Arrange
var cts = new CancellationTokenSource();
var externalToken = cts.Token;
var testAzureBlobLockResult = new AzureBlobLockResult(blob: new CloudBlob(new Uri("https://test")), lockIsTaken: false, leaseId: string.Empty, linkToken: externalToken);
var testAzureBlobLockResult = new AzureBlobLockResult(
blob: new CloudBlob(new Uri("https://test/container")),
lockIsTaken: false,
leaseId: string.Empty,
linkToken: externalToken);

// Act
testAzureBlobLockResult.BlobOperationToken.Cancel();
Expand Down

0 comments on commit c206163

Please sign in to comment.