Skip to content

Commit 83ba5cb

Browse files
committed
add tests and additional sas token validation
1 parent c6d93fb commit 83ba5cb

11 files changed

+331
-103
lines changed

src/UmbracoFileSystemProviders.Azure.Installer/UmbracoFileSystemProviders.Azure.Installer.csproj

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@
3232
<ErrorReport>prompt</ErrorReport>
3333
<WarningLevel>4</WarningLevel>
3434
</PropertyGroup>
35+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SAS Account Level|AnyCPU'">
36+
<DebugSymbols>true</DebugSymbols>
37+
<OutputPath>bin\SAS Account Level\</OutputPath>
38+
<DefineConstants>DEBUG;TRACE</DefineConstants>
39+
<DocumentationFile>bin\Debug\Our.Umbraco.FileSystemProviders.Azure.Installer.XML</DocumentationFile>
40+
<DebugType>full</DebugType>
41+
<PlatformTarget>AnyCPU</PlatformTarget>
42+
<ErrorReport>prompt</ErrorReport>
43+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
44+
</PropertyGroup>
45+
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'SAS Container Level|AnyCPU'">
46+
<DebugSymbols>true</DebugSymbols>
47+
<OutputPath>bin\SAS Container Level\</OutputPath>
48+
<DefineConstants>DEBUG;TRACE</DefineConstants>
49+
<DocumentationFile>bin\Debug\Our.Umbraco.FileSystemProviders.Azure.Installer.XML</DocumentationFile>
50+
<DebugType>full</DebugType>
51+
<PlatformTarget>AnyCPU</PlatformTarget>
52+
<ErrorReport>prompt</ErrorReport>
53+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
54+
</PropertyGroup>
3555
<ItemGroup>
3656
<Reference Include="AutoMapper, Version=3.0.0.0, Culture=neutral, processorArchitecture=MSIL">
3757
<HintPath>..\packages\AutoMapper.3.0.0\lib\net40\AutoMapper.dll</HintPath>

src/UmbracoFileSystemProviders.Azure.Tests/AzureBlobFileSystemAbsoluteTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public void ResolveUrl()
2323
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem(true);
2424

2525
// Act
26-
string actual = provider.GetUrl("1010/media.jpg");
26+
string actual = provider.GetUrl("110/image.jpg");
2727

2828
// Assert
29-
Assert.AreEqual("http://127.0.0.1:10000/devstoreaccount1/media/1010/media.jpg", actual);
29+
Assert.AreEqual($"{this.RootUrl}{this.ContainerName}/110/image.jpg", actual);
3030
}
3131

3232
/// <summary>
@@ -40,10 +40,10 @@ public void ResolveUrlPrefixed()
4040
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem(true);
4141

4242
// Act
43-
string actual = provider.GetUrl("media/1010/media.jpg");
43+
string actual = provider.GetUrl($"{this.ContainerName}/110/image.jpg");
4444

4545
// Assert
46-
Assert.AreEqual("http://127.0.0.1:10000/devstoreaccount1/media/1010/media.jpg", actual);
46+
Assert.AreEqual($"{this.RootUrl}{this.ContainerName}/110/image.jpg", actual);
4747
}
4848
}
4949
}

src/UmbracoFileSystemProviders.Azure.Tests/AzureBlobFileSystemRelativeTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ public void ResolveUrl()
2323
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem();
2424

2525
// Act
26-
string actual = provider.GetUrl("1010/media.jpg");
26+
string actual = provider.GetUrl("110/image.jpg");
2727

2828
// Assert
29-
Assert.AreEqual("/media/1010/media.jpg", actual);
29+
Assert.AreEqual($"/{this.ContainerName}/110/image.jpg", actual);
3030
}
3131

3232
/// <summary>
@@ -40,10 +40,10 @@ public void ResolveUrlPrefixed()
4040
AzureBlobFileSystem provider = this.CreateAzureBlobFileSystem();
4141

4242
// Act
43-
string actual = provider.GetUrl("media/1010/media.jpg");
43+
string actual = provider.GetUrl($"{this.ContainerName}/110/image.jpg");
4444

4545
// Assert
46-
Assert.AreEqual("/media/1010/media.jpg", actual);
46+
Assert.AreEqual($"/{this.ContainerName}/110/image.jpg", actual);
4747
}
4848
}
4949
}

0 commit comments

Comments
 (0)