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)); } } }