Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed mock resource types #39020

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Azure.Storage.DataMovement.Blobs
/// <summary>
/// The AppendBlobStorageResource class.
/// </summary>
internal class AppendBlobStorageResource : StorageResourceItem
internal class AppendBlobStorageResource : StorageResourceItemInternal
{
internal AppendBlobClient BlobClient { get; set; }
internal AppendBlobStorageResourceOptions _options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
<Compile Include="$(AzureStorageDataMovementSharedSources)JobPlanExtensions.cs" LinkBase="Shared\DataMovement" />
<Compile Include="$(AzureStorageDataMovementSharedSources)ResponseExtensions.cs" LinkBase="Shared\DataMovement" />
<Compile Include="$(AzureStorageDataMovementSharedSources)LocalTransferCheckpointer.cs" LinkBase="Shared\DataMovement" />
<Compile Include="$(AzureStorageDataMovementSharedSources)StorageResourceItemInternal.cs" LinkBase="Shared\DataMovement" />
<Compile Include="$(AzureStorageDataMovementSharedSources)StorageResourceContainerInternal.cs" LinkBase="Shared\DataMovement" />
<Compile Include="$(AzureStorageDataMovementSharedSources)TransferCheckpointer.cs" LinkBase="Shared\DataMovement" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ namespace Azure.Storage.DataMovement.Blobs
/// <summary>
/// The BlockBlobStorageResource class.
/// </summary>
internal class BlockBlobStorageResource : StorageResourceItem
internal class BlockBlobStorageResource : StorageResourceItemInternal
{
internal BlockBlobClient BlobClient { get; set; }
internal BlockBlobStorageResourceOptions _options;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Azure.Storage.DataMovement.Blobs
/// <summary>
/// The PageBlobStorageResource class.
/// </summary>
internal class PageBlobStorageResource : StorageResourceItem
internal class PageBlobStorageResource : StorageResourceItemInternal
{
internal PageBlobClient BlobClient { get; set; }
internal PageBlobStorageResourceOptions _options;
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ public async Task BlockBlobMaintainsEtagForDownloads()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockBlockBlobStorageResource storageResource = new(mock.Object);
await storageResource.MockGetPropertiesAsync();
await storageResource.MockReadStreamAsync();
BlockBlobStorageResource storageResource = new(mock.Object);
await storageResource.GetPropertiesInternalAsync();
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
Expand Down Expand Up @@ -69,9 +69,9 @@ public async Task PageBlobBlobMaintainsEtagForDownloads()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockPageBlobStorageResource storageResource = new(mock.Object);
await storageResource.MockGetPropertiesAsync();
await storageResource.MockReadStreamAsync();
PageBlobStorageResource storageResource = new(mock.Object);
await storageResource.GetPropertiesInternalAsync();
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
Expand Down Expand Up @@ -99,9 +99,9 @@ public async Task AppendBlobMaintainsEtagForDownloads()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockAppendBlobStorageResource storageResource = new(mock.Object);
await storageResource.MockGetPropertiesAsync();
await storageResource.MockReadStreamAsync();
AppendBlobStorageResource storageResource = new(mock.Object);
await storageResource.GetPropertiesInternalAsync();
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.GetPropertiesAsync(It.IsAny<BlobRequestConditions>(), It.IsAny<CancellationToken>()),
Expand All @@ -125,8 +125,8 @@ public async Task BlockBlobUsesProvidedEtag()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockBlockBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.MockReadStreamAsync();
BlockBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.DownloadStreamingAsync(
Expand All @@ -147,8 +147,8 @@ public async Task PageBlobUsesProvidedEtag()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockPageBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.MockReadStreamAsync();
PageBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.DownloadStreamingAsync(
Expand All @@ -169,8 +169,8 @@ public async Task AppendBlobUsesProvidedEtag()
BlobsModelFactory.BlobDownloadStreamingResult(Stream.Null, new BlobDownloadDetails()),
new MockResponse(201))));

MockAppendBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.MockReadStreamAsync();
AppendBlobStorageResource storageResource = new(mock.Object, length: default, etag);
await storageResource.ReadStreamInternalAsync();

mock.Verify(
b => b.DownloadStreamingAsync(
Expand Down Expand Up @@ -208,8 +208,8 @@ public async Task ContainerProvidesETagFromList()
}));

// Act
MockBlobStorageResourceContainer containerResource = new(mock.Object);
List<StorageResource> children = await containerResource.MockGetStorageResourcesAsync().ToEnumerableAsync();
BlobStorageResourceContainer containerResource = new(mock.Object);
List<StorageResource> children = await containerResource.GetStorageResourcesInternalAsync().ToEnumerableAsync();

// Assert

Expand All @@ -223,7 +223,7 @@ public async Task ContainerProvidesETagFromList()
switch (blobType)
{
case BlobType.Block:
MockBlockBlobStorageResource blockChild = new(children[i] as BlockBlobStorageResource);
BlockBlobStorageResource blockChild = children[i] as BlockBlobStorageResource;
Mock<BlockBlobClient> blockClient = new(
new Uri("https://storageaccount.blob.core.windows.net/container/blob"),
new BlobClientOptions());
Expand All @@ -233,7 +233,7 @@ public async Task ContainerProvidesETagFromList()
new MockResponse(201))));
blockChild.BlobClient = blockClient.Object;

await blockChild.MockReadStreamAsync();
await blockChild.ReadStreamInternalAsync();

blockClient.Verify(
b => b.DownloadStreamingAsync(
Expand All @@ -243,7 +243,7 @@ public async Task ContainerProvidesETagFromList()
break;

case BlobType.Page:
MockPageBlobStorageResource pageChild = new(children[i] as PageBlobStorageResource);
PageBlobStorageResource pageChild = children[i] as PageBlobStorageResource;
Mock<PageBlobClient> pageClient = new(
new Uri("https://storageaccount.blob.core.windows.net/container/blob"),
new BlobClientOptions());
Expand All @@ -253,7 +253,7 @@ public async Task ContainerProvidesETagFromList()
new MockResponse(201))));
pageChild.BlobClient = pageClient.Object;

await pageChild.MockReadStreamAsync();
await pageChild.ReadStreamInternalAsync();

pageClient.Verify(
b => b.DownloadStreamingAsync(
Expand All @@ -263,7 +263,7 @@ public async Task ContainerProvidesETagFromList()
break;

case BlobType.Append:
MockAppendBlobStorageResource appendChild = new(children[i] as AppendBlobStorageResource);
AppendBlobStorageResource appendChild = children[i] as AppendBlobStorageResource;
Mock<AppendBlobClient> appendClient = new(
new Uri("https://storageaccount.blob.core.windows.net/container/blob"),
new BlobClientOptions());
Expand All @@ -273,7 +273,7 @@ public async Task ContainerProvidesETagFromList()
new MockResponse(201))));
appendChild.BlobClient = appendClient.Object;

await appendChild.MockReadStreamAsync();
await appendChild.ReadStreamInternalAsync();

appendClient.Verify(
b => b.DownloadStreamingAsync(
Expand Down
Loading