Browse Source

fix unit test

pull/22004/head
Suhaib 1 year ago
parent
commit
5f38b486c6
  1. 15
      framework/test/Volo.Abp.BlobStoring.Bunny.Tests/Volo/Abp/BlobStoring/Bunny/AbpBlobStoringBunnyTestModule.cs

15
framework/test/Volo.Abp.BlobStoring.Bunny.Tests/Volo/Abp/BlobStoring/Bunny/AbpBlobStoringBunnyTestModule.cs

@ -2,6 +2,7 @@
using System.Threading.Tasks;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NSubstitute.Extensions;
using Volo.Abp.Modularity;
using Volo.Abp.Threading;
@ -56,18 +57,4 @@ public class AbpBlobStoringBunnyTestModule : AbpModule
});
});
}
public override void OnApplicationShutdown(ApplicationShutdownContext context)
{
AsyncHelper.RunSync(() => DeleteStorageZoneAsync(context));
}
private async Task DeleteStorageZoneAsync(ApplicationShutdownContext context)
{
var bunnyClient = new BunnyClient(_configuration.AccessKey, _configuration.ContainerName, _configuration.Region);
if (await bunnyClient.DoesStorageZoneExistAsync(_randomContainerName))
{
await bunnyClient.DeleteStorageZoneAsync(_randomContainerName);
}
}
}

Loading…
Cancel
Save