diff --git a/src/Microsoft.Azure.EventHubs/Primitives/Guard.cs b/src/Microsoft.Azure.EventHubs/Primitives/Guard.cs index 8446100..134d1c4 100644 --- a/src/Microsoft.Azure.EventHubs/Primitives/Guard.cs +++ b/src/Microsoft.Azure.EventHubs/Primitives/Guard.cs @@ -9,7 +9,7 @@ internal static void ArgumentNotNull(string argumentName, object value) { if (value == null) { - Fx.Exception.ArgumentNull(argumentName); + throw Fx.Exception.ArgumentNull(argumentName); } } @@ -17,7 +17,7 @@ internal static void ArgumentNotNullOrWhiteSpace(string argumentName, string val { if (string.IsNullOrWhiteSpace(value)) { - Fx.Exception.ArgumentNull(argumentName); + throw Fx.Exception.ArgumentNull(argumentName); } } } diff --git a/test/Microsoft.Azure.EventHubs.Tests/Client/NegativeCases.cs b/test/Microsoft.Azure.EventHubs.Tests/Client/NegativeCases.cs index 7ad432b..17be408 100644 --- a/test/Microsoft.Azure.EventHubs.Tests/Client/NegativeCases.cs +++ b/test/Microsoft.Azure.EventHubs.Tests/Client/NegativeCases.cs @@ -130,7 +130,7 @@ await Assert.ThrowsAsync(async () => invalidPartitions = new List() { "", " ", null }; foreach (var invalidPartitionId in invalidPartitions) { - await Assert.ThrowsAsync(async () => + await Assert.ThrowsAsync(async () => { TestUtility.Log($"Sending to invalid partition {invalidPartitionId}"); sender = this.EventHubClient.CreatePartitionSender(invalidPartitionId); @@ -162,7 +162,7 @@ await Assert.ThrowsAsync(async () => invalidPartitions = new List() { "", " ", null }; foreach (var invalidPartitionId in invalidPartitions) { - await Assert.ThrowsAsync(async () => + await Assert.ThrowsAsync(async () => { TestUtility.Log($"Getting partition information from invalid partition {invalidPartitionId}"); await this.EventHubClient.GetPartitionRuntimeInformationAsync(invalidPartitionId); @@ -179,7 +179,7 @@ Task CreateClientWithoutEntityPathShouldFail() var csb = new EventHubsConnectionStringBuilder(TestUtility.EventHubsConnectionString); csb.EntityPath = null; - return Assert.ThrowsAsync(() => + return Assert.ThrowsAsync(() => { EventHubClient.CreateFromConnectionString(csb.ToString()); throw new Exception("Entity path wasn't provided in the connection string and this new call was supposed to fail");