-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Storage] [WebJobs] Added test for Blob Path for various blob names t…
…o check for blob name validation (#45015) * Added test for Blob Path for possible blob names, to ensure paths are not truncated * CI changelog error * Fix CI change log part 2
- Loading branch information
Showing
5 changed files
with
44 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Blobs/tests/BlobPathTests.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Azure.Storage.Blobs; | ||
using NUnit.Framework; | ||
|
||
namespace Microsoft.Azure.WebJobs.Extensions.Storage.Blobs.Tests | ||
{ | ||
public class BlobPathTests | ||
{ | ||
[Test] | ||
[TestCase("blobName")] | ||
[TestCase("blob_Name")] | ||
[TestCase("blob_Nam/e324324.txt")] | ||
[TestCase("!*'();[]:@&%=+$,/#äÄöÖüÜß")] | ||
public void BlobPathTryParseAbsUrl(string blobName) | ||
{ | ||
string uriStr = "https://account.blob.core.windows.net/container/" + blobName; | ||
if (BlobPath.TryParseAbsUrl(uriStr, out BlobPath path)) | ||
{ | ||
Assert.AreEqual(blobName, path.BlobName); | ||
} | ||
else | ||
{ | ||
Assert.Fail("Failed to parse blob name"); | ||
} | ||
} | ||
} | ||
} |
11 changes: 9 additions & 2 deletions
11
sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage.Common/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 1 addition & 8 deletions
9
sdk/storage/Microsoft.Azure.WebJobs.Extensions.Storage/CHANGELOG.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters