-
Notifications
You must be signed in to change notification settings - Fork 297
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
125 changed files
with
4,345 additions
and
3,758 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
Test/DurableTask.AzureStorage.Tests/Storage/DurableTaskStorageExceptionTests.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,44 @@ | ||
// ---------------------------------------------------------------------------------- | ||
// Copyright Microsoft Corporation | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ---------------------------------------------------------------------------------- | ||
#nullable enable | ||
namespace DurableTask.AzureStorage.Tests.Storage | ||
{ | ||
using System.Net; | ||
using Azure; | ||
using Azure.Storage.Blobs.Models; | ||
using DurableTask.AzureStorage.Storage; | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
|
||
[TestClass] | ||
public class DurableTaskStorageExceptionTests | ||
{ | ||
[TestMethod] | ||
public void MissingRequestFailedException() | ||
{ | ||
DurableTaskStorageException exception = new((RequestFailedException)null!); | ||
Assert.AreEqual(0, exception.HttpStatusCode); | ||
Assert.IsFalse(exception.LeaseLost); | ||
} | ||
|
||
[DataTestMethod] | ||
[DataRow(true, HttpStatusCode.Conflict, nameof(BlobErrorCode.LeaseLost))] | ||
[DataRow(false, HttpStatusCode.Conflict, nameof(BlobErrorCode.LeaseNotPresentWithBlobOperation))] | ||
[DataRow(false, HttpStatusCode.NotFound, nameof(BlobErrorCode.BlobNotFound))] | ||
public void ValidRequestFailedException(bool expectedLease, HttpStatusCode statusCode, string errorCode) | ||
{ | ||
DurableTaskStorageException exception = new(new RequestFailedException((int)statusCode, "Error!", errorCode, innerException: null)); | ||
Assert.AreEqual((int)statusCode, exception.HttpStatusCode); | ||
Assert.AreEqual(expectedLease, exception.LeaseLost); | ||
} | ||
} | ||
} |
37 changes: 0 additions & 37 deletions
37
Test/DurableTask.AzureStorage.Tests/Storage/StorageUriExtensionsTests.cs
This file was deleted.
Oops, something went wrong.
89 changes: 0 additions & 89 deletions
89
Test/DurableTask.AzureStorage.Tests/StorageAccountDetailsTests.cs
This file was deleted.
Oops, something went wrong.
138 changes: 0 additions & 138 deletions
138
Test/DurableTask.AzureStorage.Tests/TimeoutHandlerTests.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.