From f65dd510df53cfc091397a0e42d6ec3750533c5b Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:01:18 +0100 Subject: [PATCH 1/3] chore(blob): remove temp blob file options --- .../TemporaryBlobContainer.cs | 18 +- .../TemporaryBlobFile.cs | 188 +----------------- .../Storage/TemporaryBlobFileTests.cs | 119 +---------- .../Storage/TemporaryBlobFileTests.cs | 38 ---- 4 files changed, 17 insertions(+), 346 deletions(-) diff --git a/src/Arcus.Testing.Storage.Blob/TemporaryBlobContainer.cs b/src/Arcus.Testing.Storage.Blob/TemporaryBlobContainer.cs index 8aa59c0d..26a08380 100644 --- a/src/Arcus.Testing.Storage.Blob/TemporaryBlobContainer.cs +++ b/src/Arcus.Testing.Storage.Blob/TemporaryBlobContainer.cs @@ -550,22 +550,6 @@ private static async Task EnsureContainerCreatedAsync(BlobContainerClient /// Thrown when the is blank. /// Thrown when the is null. public async Task UploadBlobAsync(string blobName, BinaryData blobContent) - { - return await UploadBlobAsync(blobName, blobContent, configureOptions: null); - } - - /// - /// Uploads a temporary blob to the Azure Blob container. - /// - /// The name of the blob to upload. - /// The content of the blob to upload. - /// The function to configure the additional options of how the blob should be uploaded. - /// Thrown when the is blank. - /// Thrown when the is null. - [Obsolete( - "Use the " + nameof(TemporaryBlobContainerOptions) + " instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, overload with options will be removed in v2.0")] - public async Task UploadBlobAsync(string blobName, BinaryData blobContent, Action configureOptions) { ArgumentNullException.ThrowIfNull(blobContent); @@ -575,7 +559,7 @@ public async Task UploadBlobAsync(string blobName, BinaryData blobCo } BlobClient blobClient = Client.GetBlobClient(blobName); - _blobs.Add(await TemporaryBlobFile.UploadIfNotExistsAsync(blobClient, blobContent, _logger, configureOptions)); + _blobs.Add(await TemporaryBlobFile.UploadIfNotExistsAsync(blobClient, blobContent, _logger)); return blobClient; } diff --git a/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs b/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs index fd19603e..dcb32b09 100644 --- a/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs +++ b/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs @@ -6,100 +6,8 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; -#pragma warning disable CS0618, S1133 // Ignore obsolete warnings that we added ourselves, should be removed upon releasing v2.0. - namespace Arcus.Testing { - /// - /// Represents the available options when creating a . - /// - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, options will be removed in v2.0")] - public class OnSetupBlobFileOptions - { - /// - /// Gets the configured setup option on what to do with an existing Azure Blob file upon creation. - /// - /// - /// [true] overrides the existing Azure Blob file when it already exists; - /// [false] uses the existing Azure Blob file's content instead. - /// - internal bool OverrideBlob { get; private set; } - - /// - /// (default) Configures the to override an existing Azure Blob file when it already exists. - /// - public OnSetupBlobFileOptions OverrideExistingBlob() - { - OverrideBlob = true; - return this; - } - - /// - /// Configures the to use the existing Azure Blob file's content instead when it already exists. - /// - public OnSetupBlobFileOptions UseExistingBlob() - { - OverrideBlob = false; - return this; - } - } - - /// - /// Represents the available options when tearing down a . - /// - internal enum OnTeardownBlob { DeleteIfCreated, DeleteIfExisted } - - /// - /// Represents the available options when deleting a . - /// - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, options will be removed in v2.0")] - public class OnTeardownBlobFileOptions - { - /// - /// Gets the configured teardown option on what to do with the Azure Blob content upon disposal. - /// - internal OnTeardownBlob Content { get; private set; } - - /// - /// (default) Configures the to delete the Azure Blob file upon disposal if the test fixture created the file. - /// - public OnTeardownBlobFileOptions DeleteCreatedBlob() - { - Content = OnTeardownBlob.DeleteIfCreated; - return this; - } - - /// - /// Configures the to delete the Azure Blob file upon disposal, even if it already existed - outside the fixture's scope. - /// - /// - public OnTeardownBlobFileOptions DeleteExistingBlob() - { - Content = OnTeardownBlob.DeleteIfExisted; - return this; - } - } - - /// - /// Represents the available options when uploading a . - /// - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, options will be removed in v2.0")] - public class TemporaryBlobFileOptions - { - /// - /// Gets the additional options to manipulate the creation of the . - /// - public OnSetupBlobFileOptions OnSetup { get; } = new OnSetupBlobFileOptions().UseExistingBlob(); - - /// - /// Gets the additional options to manipulate the deletion of the . - /// - public OnTeardownBlobFileOptions OnTeardown { get; } = new OnTeardownBlobFileOptions().DeleteCreatedBlob(); - } - /// /// Represents a temporary Azure Blob file that will be deleted after the instance is disposed. /// @@ -107,22 +15,18 @@ public class TemporaryBlobFile : IAsyncDisposable { private readonly bool _createdByUs; private readonly BinaryData _originalData; - private readonly TemporaryBlobFileOptions _options; private readonly ILogger _logger; private TemporaryBlobFile( BlobClient blobClient, bool createdByUs, BinaryData originalData, - TemporaryBlobFileOptions options, ILogger logger) { ArgumentNullException.ThrowIfNull(blobClient); - ArgumentNullException.ThrowIfNull(options); _createdByUs = createdByUs; _originalData = originalData; - _options = options; _logger = logger ?? NullLogger.Instance; Client = blobClient; @@ -143,13 +47,6 @@ private TemporaryBlobFile( /// public BlobClient Client { get; } - /// - /// Gets the additional options to manipulate the deletion of the . - /// - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown")] - public OnTeardownBlobFileOptions OnTeardown => _options.OnTeardown; - /// /// Uploads a temporary blob to the Azure Blob container. /// @@ -172,42 +69,6 @@ public static async Task UploadIfNotExistsAsync(Uri blobConta throw new ArgumentException("Requires a non-blank name for the Azure Blob file name for it to be uploaded to Azure Blob storage", nameof(blobName)); } - return await UploadIfNotExistsAsync( - blobContainerUri, - blobName, - blobContent, - logger, - configureOptions: null); - } - - /// - /// Uploads a temporary blob to the Azure Blob container. - /// - /// - /// Uses to authenticate with Azure Blob storage. - /// - /// - /// A referencing the blob container that includes the name of the account and the name of the container. - /// This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_name}". - /// - /// The name of the blob to upload. - /// The content of the blob to upload. - /// The logger to write diagnostic messages during the upload process. - /// The function to configure the additional options of how the blob should be uploaded. - /// Thrown when the is blank. - /// Thrown when or the is null. - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, this overload with options will be removed in v2.0")] - public static async Task UploadIfNotExistsAsync( - Uri blobContainerUri, - string blobName, - BinaryData blobContent, - ILogger logger, - Action configureOptions) - { - ArgumentNullException.ThrowIfNull(blobContainerUri); - ArgumentNullException.ThrowIfNull(blobContent); - if (string.IsNullOrWhiteSpace(blobName)) { throw new ArgumentException("Requires a non-blank name for the Azure Blob file name for it to be uploaded to Azure Blob storage", nameof(blobName)); @@ -216,7 +77,7 @@ public static async Task UploadIfNotExistsAsync( var containerClient = new BlobContainerClient(blobContainerUri, new DefaultAzureCredential()); BlobClient blobClient = containerClient.GetBlobClient(blobName); - return await UploadIfNotExistsAsync(blobClient, blobContent, logger, configureOptions); + return await UploadIfNotExistsAsync(blobClient, blobContent, logger); } /// @@ -227,53 +88,27 @@ public static async Task UploadIfNotExistsAsync( /// The logger to write diagnostic messages during the upload process. /// Thrown when the or the is null. public static async Task UploadIfNotExistsAsync(BlobClient blobClient, BinaryData blobContent, ILogger logger) - { - return await UploadIfNotExistsAsync(blobClient, blobContent, logger, configureOptions: null); - } - - /// - /// Uploads a temporary blob to the Azure Blob container. - /// - /// The Azure Blob client to interact with Azure Blob storage. - /// The content of the blob to upload. - /// The logger to write diagnostic messages during the upload process. - /// The function to configure the additional options of how the blob should be uploaded. - /// Thrown when the or the is null. - [Obsolete("Use the '" + nameof(TemporaryBlobContainerOptions) + "' instead on Azure Blob storage container-level to control " + - "whether or not existing/non-existing files should be cleaned during setup/teardown, this overload with options will be removed in v2.0")] - public static async Task UploadIfNotExistsAsync( - BlobClient blobClient, - BinaryData blobContent, - ILogger logger, - Action configureOptions) { ArgumentNullException.ThrowIfNull(blobClient); ArgumentNullException.ThrowIfNull(blobContent); logger ??= NullLogger.Instance; - var options = new TemporaryBlobFileOptions(); - configureOptions?.Invoke(options); - - (bool createdByUs, BinaryData originalData) = await EnsureBlobContentCreatedAsync(blobClient, blobContent, options, logger); + (bool createdByUs, BinaryData originalData) = await EnsureBlobContentCreatedAsync(blobClient, blobContent, logger); - return new TemporaryBlobFile(blobClient, createdByUs, originalData, options, logger); + return new TemporaryBlobFile(blobClient, createdByUs, originalData, logger); } private static async Task<(bool createdByUs, BinaryData originalData)> EnsureBlobContentCreatedAsync( BlobClient client, BinaryData newContent, - TemporaryBlobFileOptions options, ILogger logger) { if (await client.ExistsAsync()) { BlobDownloadResult originalContent = await client.DownloadContentAsync(); - if (options.OnSetup.OverrideBlob) - { - logger.LogDebug("[Test:Setup] Replace already existing Azure Blob file '{BlobName}' in container '{AccountName}/{ContainerName}'", client.Name, client.AccountName, client.BlobContainerName); - await client.UploadAsync(newContent, overwrite: true); - } + logger.LogDebug("[Test:Setup] Replace already existing Azure Blob file '{BlobName}' in container '{AccountName}/{ContainerName}'", client.Name, client.AccountName, client.BlobContainerName); + await client.UploadAsync(newContent, overwrite: true); return (createdByUs: false, originalContent.Content); } @@ -290,17 +125,16 @@ public static async Task UploadIfNotExistsAsync( /// A task that represents the asynchronous dispose operation. public async ValueTask DisposeAsync() { - if (!_createdByUs && _originalData != null && _options.OnTeardown.Content != OnTeardownBlob.DeleteIfExisted) - { - _logger.LogDebug("[Test:Teardown] Revert replaced Azure Blob file '{BlobName}' to original content in container '{AccountName}/{ContainerName}'", Client.Name, Client.AccountName, Client.BlobContainerName); - await Client.UploadAsync(_originalData, overwrite: true); - } - - if (_createdByUs || _options.OnTeardown.Content is OnTeardownBlob.DeleteIfExisted) + if (_createdByUs) { _logger.LogDebug("[Test:Teardown] Delete Azure Blob file '{BlobName}' from container '{AccountName}/{ContainerName}'", Client.Name, Client.AccountName, Client.BlobContainerName); await Client.DeleteIfExistsAsync(); } + else if (_originalData != null) + { + _logger.LogDebug("[Test:Teardown] Revert replaced Azure Blob file '{BlobName}' to original content in container '{AccountName}/{ContainerName}'", Client.Name, Client.AccountName, Client.BlobContainerName); + await Client.UploadAsync(_originalData, overwrite: true); + } GC.SuppressFinalize(this); } diff --git a/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs b/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs index 03e23db1..bd598cfa 100644 --- a/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs +++ b/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs @@ -5,8 +5,6 @@ using Xunit; using Xunit.Abstractions; -#pragma warning disable CS0618 // Ignore obsolete warnings that we added ourselves, should be removed upon releasing v2.0. - namespace Arcus.Testing.Tests.Integration.Storage { [Collection(TestCollections.BlobStorage)] @@ -28,7 +26,7 @@ public async Task UploadTempBlobFileCreatedByUs_WithAvailableBlobContainer_Succe BlobContainerClient containerClient = await context.WhenBlobContainerAvailableAsync(); BinaryData content = context.CreateBlobContent(); - TemporaryBlobFile file = await WhenBlobUploadedAsync(containerClient, blobContent: content, configureOptions: AnyOptions()); + TemporaryBlobFile file = await WhenBlobUploadedAsync(containerClient, blobContent: content); await context.ShouldStoreBlobFileAsync(containerClient, file.Name, content); // Act @@ -38,35 +36,6 @@ public async Task UploadTempBlobFileCreatedByUs_WithAvailableBlobContainer_Succe await context.ShouldDeleteBlobFileAsync(containerClient, file.Name); } - private static Action AnyOptions() - { - if (Bogus.Random.Bool()) - { - return null; - } - - return options => - { - if (Bogus.Random.Bool()) - { - options.OnSetup.OverrideExistingBlob(); - } - else - { - options.OnSetup.UseExistingBlob(); - } - - if (Bogus.Random.Bool()) - { - options.OnTeardown.DeleteCreatedBlob(); - } - else - { - options.OnTeardown.DeleteExistingBlob(); - } - }; - } - [Fact] public async Task UploadTempBlobFileDefault_WithAlreadyUploadedBlob_SucceedsByUsingExistingBlob() { @@ -86,96 +55,18 @@ public async Task UploadTempBlobFileDefault_WithAlreadyUploadedBlob_SucceedsByUs await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, originalContent); } - [Fact] - public async Task UploadTempBlobFile_WithAlreadyUploadedBlobWithoutOverride_SucceedsByUsingSameContent() - { - // Arrange - await using var context = await GivenBlobStorageAsync(); - - BlobContainerClient containerClient = await context.WhenBlobContainerAvailableAsync(); - - BinaryData originalContent = context.CreateBlobContent(); - BlobClient existingBlob = await context.WhenBlobAvailableAsync(containerClient, blobContent: originalContent); - BinaryData newContent = context.CreateBlobContent(); - - // Act - TemporaryBlobFile sut = await WhenBlobUploadedAsync(containerClient, existingBlob.Name, newContent, configureOptions: options => - { - options.OnSetup.UseExistingBlob(); - }); - - // Assert - await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, originalContent); - await sut.DisposeAsync(); - await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, originalContent); - } - - [Fact] - public async Task UploadTempBlobFileWithDeleteExisting_WithAlreadyUploadedBlob_SucceedsByRemovingUponDisposal() - { - // Arrange - await using var context = await GivenBlobStorageAsync(); - - BlobContainerClient containerClient = await context.WhenBlobContainerAvailableAsync(); - BlobClient existingBlob = await context.WhenBlobAvailableAsync(containerClient); - TemporaryBlobFile sut = await WhenBlobUploadedAsync(containerClient, existingBlob.Name, configureOptions: options => - { - options.OnTeardown.DeleteExistingBlob(); - }); - - // Act - await sut.DisposeAsync(); - - // Assert - await context.ShouldDeleteBlobFileAsync(containerClient, sut.Name); - } - - [Fact] - public async Task UploadTempBlobFileWithAllAvailableOutOfScopeOptions_OnExistingBlob_SucceedsByRemovingAll() - { - // Arrange - await using var context = await GivenBlobStorageAsync(); - - BlobContainerClient containerClient = await context.WhenBlobContainerAvailableAsync(); - - BinaryData originalContent = context.CreateBlobContent(); - BlobClient existingBlob = await context.WhenBlobAvailableAsync(containerClient, blobContent: originalContent); - - BinaryData newContent = context.CreateBlobContent(); - TemporaryBlobFile sut = await WhenBlobUploadedAsync(containerClient, existingBlob.Name, newContent, configureOptions: options => - { - options.OnSetup.UseExistingBlob(); - }); - sut.OnTeardown.DeleteExistingBlob(); - await context.ShouldStoreBlobFileAsync(containerClient, sut.Name, originalContent); - - // Act - await sut.DisposeAsync(); - - // Assert - await context.ShouldDeleteBlobFileAsync(containerClient, existingBlob.Name); - } - private async Task WhenBlobUploadedAsync( BlobContainerClient client, string blobName = null, - BinaryData blobContent = null, - Action configureOptions = null) + BinaryData blobContent = null) { blobName ??= $"test-{Guid.NewGuid():N}"; blobContent ??= BinaryData.FromBytes(Bogus.Random.Bytes(100)); -#pragma warning disable S3358 // Sonar suggests extracting nested condition, but methods are now deprecated and will be removed with v2.0 anyway. - - TemporaryBlobFile temp = configureOptions is null - ? Bogus.Random.Bool() + TemporaryBlobFile temp = + Bogus.Random.Bool() ? await TemporaryBlobFile.UploadIfNotExistsAsync(client.Uri, blobName, blobContent, Logger) - : await TemporaryBlobFile.UploadIfNotExistsAsync(client.GetBlobClient(blobName), blobContent, Logger) - : Bogus.Random.Bool() - ? await TemporaryBlobFile.UploadIfNotExistsAsync(client.Uri, blobName, blobContent, Logger, configureOptions) - : await TemporaryBlobFile.UploadIfNotExistsAsync(client.GetBlobClient(blobName), blobContent, Logger, configureOptions); - -#pragma warning disable + : await TemporaryBlobFile.UploadIfNotExistsAsync(client.GetBlobClient(blobName), blobContent, Logger); Assert.Equal(blobName, temp.Name); Assert.Equal(client.Name, temp.ContainerName); diff --git a/src/Arcus.Testing.Tests.Unit/Storage/TemporaryBlobFileTests.cs b/src/Arcus.Testing.Tests.Unit/Storage/TemporaryBlobFileTests.cs index bad1e3a7..82941d51 100644 --- a/src/Arcus.Testing.Tests.Unit/Storage/TemporaryBlobFileTests.cs +++ b/src/Arcus.Testing.Tests.Unit/Storage/TemporaryBlobFileTests.cs @@ -18,14 +18,6 @@ await Assert.ThrowsAnyAsync( "", BinaryData.FromString(""), NullLogger.Instance)); - - await Assert.ThrowsAnyAsync( - () => TemporaryBlobFile.UploadIfNotExistsAsync( - blobContainerUri: null, - "", - BinaryData.FromString(""), - NullLogger.Instance, - configureOptions: opt => { })); } [Theory] @@ -38,14 +30,6 @@ await Assert.ThrowsAnyAsync( blobName, BinaryData.FromString(""), NullLogger.Instance)); - - await Assert.ThrowsAnyAsync( - () => TemporaryBlobFile.UploadIfNotExistsAsync( - new Uri("https://some-url"), - blobName, - BinaryData.FromString(""), - NullLogger.Instance, - configureOptions: opt => { })); } [Fact] @@ -57,14 +41,6 @@ await Assert.ThrowsAnyAsync( "", blobContent: null, NullLogger.Instance)); - - await Assert.ThrowsAnyAsync( - () => TemporaryBlobFile.UploadIfNotExistsAsync( - new Uri("https://some-url"), - "", - blobContent: null, - NullLogger.Instance, - configureOptions: opt => { })); } [Fact] @@ -75,13 +51,6 @@ await Assert.ThrowsAnyAsync( blobClient: null, BinaryData.FromString(""), NullLogger.Instance)); - - await Assert.ThrowsAnyAsync( - () => TemporaryBlobFile.UploadIfNotExistsAsync( - blobClient: null, - BinaryData.FromString(""), - NullLogger.Instance, - configureOptions: opt => { })); } [Fact] @@ -93,13 +62,6 @@ await Assert.ThrowsAnyAsync( client, blobContent: null, NullLogger.Instance)); - - await Assert.ThrowsAnyAsync( - () => TemporaryBlobFile.UploadIfNotExistsAsync( - client, - blobContent: null, - NullLogger.Instance, - opt => { })); } } } From 4287f3d0a6cda9412c7746ee03b74739b7aec901 Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:08:54 +0100 Subject: [PATCH 2/3] fix(blob): add missing arg-null check --- src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs b/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs index dcb32b09..1c23f879 100644 --- a/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs +++ b/src/Arcus.Testing.Storage.Blob/TemporaryBlobFile.cs @@ -64,10 +64,7 @@ private TemporaryBlobFile( /// Thrown when or the is null. public static async Task UploadIfNotExistsAsync(Uri blobContainerUri, string blobName, BinaryData blobContent, ILogger logger) { - if (string.IsNullOrWhiteSpace(blobName)) - { - throw new ArgumentException("Requires a non-blank name for the Azure Blob file name for it to be uploaded to Azure Blob storage", nameof(blobName)); - } + ArgumentNullException.ThrowIfNull(blobContainerUri); if (string.IsNullOrWhiteSpace(blobName)) { From db1559d4c533788e186ca634f73cfbdbf24c7a4b Mon Sep 17 00:00:00 2001 From: stijnmoreels <9039753+stijnmoreels@users.noreply.github.com> Date: Tue, 4 Mar 2025 08:40:47 +0100 Subject: [PATCH 3/3] fix(blob): correct new temp blob func --- .../Storage/TemporaryBlobFileTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs b/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs index bd598cfa..efe52b77 100644 --- a/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs +++ b/src/Arcus.Testing.Tests.Integration/Storage/TemporaryBlobFileTests.cs @@ -37,7 +37,7 @@ public async Task UploadTempBlobFileCreatedByUs_WithAvailableBlobContainer_Succe } [Fact] - public async Task UploadTempBlobFileDefault_WithAlreadyUploadedBlob_SucceedsByUsingExistingBlob() + public async Task UploadTempBlobFileDefault_WithAlreadyUploadedBlob_SucceedsByUsingOverridingContentDuringLifetimeFixture() { // Arrange await using var context = await GivenBlobStorageAsync(); @@ -50,7 +50,7 @@ public async Task UploadTempBlobFileDefault_WithAlreadyUploadedBlob_SucceedsByUs TemporaryBlobFile sut = await WhenBlobUploadedAsync(containerClient, existingBlob.Name, newContent); // Assert - await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, originalContent); + await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, newContent); await sut.DisposeAsync(); await context.ShouldStoreBlobFileAsync(containerClient, existingBlob.Name, originalContent); }