Skip to content

Commit 5f6b290

Browse files
committed
Fixed certificate scenario tests without aggregate exception and added proper ps wrapper classses
1 parent 7f06450 commit 5f6b290

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1927
-13352
lines changed

src/ResourceManager/AzureBatch/Commands.Batch.Test/ScenarioTests/ScenarioTestHelpers.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,16 +134,12 @@ public static string AddTestCertificate(BatchController controller, BatchAccount
134134
existingCert = client.ListCertificates(getParameters).FirstOrDefault();
135135
}
136136
}
137-
catch (AggregateException ex)
137+
catch (BatchException ex)
138138
{
139-
foreach (Exception inner in ex.InnerExceptions)
139+
// When the cert doesn't exist, we get a 404 error. For all other errors, throw.
140+
if (ex == null || !ex.Message.Contains("NotFound"))
140141
{
141-
BatchException batchEx = inner as BatchException;
142-
// When the cert doesn't exist, we get a 404 error. For all other errors, throw.
143-
if (batchEx == null || !batchEx.Message.Contains("NotFound"))
144-
{
145-
throw;
146-
}
142+
throw;
147143
}
148144
}
149145

src/ResourceManager/AzureBatch/Commands.Batch.Test/SessionRecords/Microsoft.Azure.Commands.Batch.Test.ScenarioTests.CertificateTests/TestCancelCertificateDelete.json

Lines changed: 284 additions & 256 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)