Skip to content

Commit c858945

Browse files
committed
added explicit WindowsAzure.Storage reference to downstream NuGet.Services.V3; fixed test
1 parent e8d617a commit c858945

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

src/NuGet.Services.V3/NuGet.Services.V3.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
</PropertyGroup>
99

1010
<ItemGroup>
11+
<PackageReference Include="WindowsAzure.Storage" />
1112
<ProjectReference Include="..\Catalog\NuGet.Services.Metadata.Catalog.csproj" />
1213
<ProjectReference Include="..\Validation.Common.Job\Validation.Common.Job.csproj" />
1314
</ItemGroup>

tests/Validation.Common.Job.Tests/Leases/BlobStorageFixture.cs

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
5-
using Microsoft.WindowsAzure.Storage;
6-
using Microsoft.WindowsAzure.Storage.Blob;
5+
using Azure.Storage.Blobs;
76

87
namespace Validation.Common.Job.Tests.Leases
98
{
@@ -30,23 +29,21 @@ public BlobStorageFixture()
3029
TestRunId = Guid.NewGuid().ToString();
3130
ConnectionString = GetEnvironmentVariable(ConnectionStringName, required: true);
3231

33-
GetContainerReference().CreateIfNotExists();
32+
GetBlobContainerClient().CreateIfNotExists();
3433
}
3534

3635
public string TestRunId { get; }
3736
public string ConnectionString { get; }
3837

3938
public void Dispose()
4039
{
41-
GetContainerReference().DeleteIfExists();
40+
GetBlobContainerClient().DeleteIfExists();
4241
}
4342

44-
private CloudBlobContainer GetContainerReference()
43+
private BlobContainerClient GetBlobContainerClient()
4544
{
46-
var account = CloudStorageAccount.Parse(ConnectionString);
47-
var blobClient = account.CreateCloudBlobClient();
48-
var container = blobClient.GetContainerReference(TestRunId);
49-
return container;
45+
var blobServiceClient = new BlobServiceClient(ConnectionString);
46+
return blobServiceClient.GetBlobContainerClient(TestRunId);
5047
}
5148

5249
private static string GetEnvironmentVariable(string name, bool required)

0 commit comments

Comments
 (0)