From c2fa54729d0eeb34831a9bfa48c733e4ac9727fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Halil=20=C4=B0brahim=20Kalkan?= Date: Tue, 26 May 2020 12:41:14 +0300 Subject: [PATCH] Added test: Default_Settings_With_TenantId --- .../BlogFilePathCalculator_Tests.cs | 27 +++++++++++++------ 1 file changed, 19 insertions(+), 8 deletions(-) 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) {