From 38c7dec8ffd6d5c2afe0ed747cea71882139b1d1 Mon Sep 17 00:00:00 2001 From: Josh Lai Date: Tue, 24 Nov 2020 09:01:22 -0800 Subject: [PATCH] [HMACAuthenticationPolicyTest] added new not null check for authValue --- .../tests/Pipeline/HMACAuthenticationPolicyTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/communication/Azure.Communication.Common/tests/Pipeline/HMACAuthenticationPolicyTests.cs b/sdk/communication/Azure.Communication.Common/tests/Pipeline/HMACAuthenticationPolicyTests.cs index 81decee42fdd0..e5f4d95343c4f 100644 --- a/sdk/communication/Azure.Communication.Common/tests/Pipeline/HMACAuthenticationPolicyTests.cs +++ b/sdk/communication/Azure.Communication.Common/tests/Pipeline/HMACAuthenticationPolicyTests.cs @@ -30,8 +30,8 @@ public async Task TestHMACPolicyProcess() var expectedAuthHeader = "HMAC-SHA256 SignedHeaders=date;host;x-ms-content-sha256"; Assert.True(headers.TryGetValue("Authorization", out var authValue)); - authValue = (authValue == null) ? "" : authValue; - Assert.True(authValue.Contains(expectedAuthHeader)); + Assert.NotNull(authValue); + Assert.True(authValue!.Contains(expectedAuthHeader)); } } }