diff --git a/framework/test/Volo.Abp.BlobStoring.FileSystem.Tests/Volo/Abp/BlobStoring/FileSystem/BlogFilePathCalculator_Tests.cs b/framework/test/Volo.Abp.BlobStoring.FileSystem.Tests/Volo/Abp/BlobStoring/FileSystem/BlogFilePathCalculator_Tests.cs index a8a02fb7af..2493dab733 100644 --- a/framework/test/Volo.Abp.BlobStoring.FileSystem.Tests/Volo/Abp/BlobStoring/FileSystem/BlogFilePathCalculator_Tests.cs +++ b/framework/test/Volo.Abp.BlobStoring.FileSystem.Tests/Volo/Abp/BlobStoring/FileSystem/BlogFilePathCalculator_Tests.cs @@ -8,7 +8,7 @@ namespace Volo.Abp.BlobStoring.FileSystem public class BlogFilePathCalculator_Tests : AbpBlobStoringFileSystemTestBase { private readonly IBlogFilePathCalculator _calculator; - + public BlogFilePathCalculator_Tests() { _calculator = GetRequiredService(); @@ -18,26 +18,37 @@ namespace Volo.Abp.BlobStoring.FileSystem public void Default_Settings() { var separator = Path.DirectorySeparatorChar; - + _calculator.Calculate( - GetArgs($"C:{separator}my-files","my-container","my-blob") + GetArgs($"C:{separator}my-files", "my-container", "my-blob") ).ShouldBe($"C:{separator}my-files{separator}host{separator}my-container{separator}my-blob"); } - + + [Fact] + public void Default_Settings_With_TenantId() + { + var separator = Path.DirectorySeparatorChar; + var tenantId = Guid.NewGuid(); + + _calculator.Calculate( + GetArgs($"C:{separator}my-files", "my-container", "my-blob", tenantId: tenantId) + ).ShouldBe($"C:{separator}my-files{separator}tenants{separator}{tenantId:D}{separator}my-container{separator}my-blob"); + } + [Fact] public void AppendContainerNameToBasePath_Set_To_False() { var separator = Path.DirectorySeparatorChar; - + _calculator.Calculate( - GetArgs($"C:{separator}my-files","my-container","my-blob", appendContainerNameToBasePath: false) + GetArgs($"C:{separator}my-files", "my-container", "my-blob", appendContainerNameToBasePath: false) ).ShouldBe($"C:{separator}my-files{separator}host{separator}my-blob"); } private BlobProviderArgs GetArgs( string basePath, - string containerName, - string blobName, + string containerName, + string blobName, Guid? tenantId = null, bool? appendContainerNameToBasePath = null) {