Skip to content

Commit

Permalink
Change a few expecting exceptions (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
David Revoledo authored and serkantkaraca committed Nov 19, 2018
1 parent 27aa79c commit c5a9f05
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/Microsoft.Azure.EventHubs/Primitives/Guard.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ internal static void ArgumentNotNull(string argumentName, object value)
{
if (value == null)
{
Fx.Exception.ArgumentNull(argumentName);
throw Fx.Exception.ArgumentNull(argumentName);
}
}

internal static void ArgumentNotNullOrWhiteSpace(string argumentName, string value)
{
if (string.IsNullOrWhiteSpace(value))
{
Fx.Exception.ArgumentNull(argumentName);
throw Fx.Exception.ArgumentNull(argumentName);
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/Microsoft.Azure.EventHubs.Tests/Client/NegativeCases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ await Assert.ThrowsAsync<ArgumentOutOfRangeException>(async () =>
invalidPartitions = new List<string>() { "", " ", null };
foreach (var invalidPartitionId in invalidPartitions)
{
await Assert.ThrowsAsync<ArgumentException>(async () =>
await Assert.ThrowsAsync<ArgumentNullException>(async () =>
{
TestUtility.Log($"Sending to invalid partition {invalidPartitionId}");
sender = this.EventHubClient.CreatePartitionSender(invalidPartitionId);
Expand Down Expand Up @@ -162,7 +162,7 @@ await Assert.ThrowsAsync<InvalidOperationException>(async () =>
invalidPartitions = new List<string>() { "", " ", null };
foreach (var invalidPartitionId in invalidPartitions)
{
await Assert.ThrowsAsync<ArgumentException>(async () =>
await Assert.ThrowsAsync<ArgumentNullException>(async () =>
{
TestUtility.Log($"Getting partition information from invalid partition {invalidPartitionId}");
await this.EventHubClient.GetPartitionRuntimeInformationAsync(invalidPartitionId);
Expand All @@ -179,7 +179,7 @@ Task CreateClientWithoutEntityPathShouldFail()
var csb = new EventHubsConnectionStringBuilder(TestUtility.EventHubsConnectionString);
csb.EntityPath = null;

return Assert.ThrowsAsync<ArgumentException>(() =>
return Assert.ThrowsAsync<ArgumentNullException>(() =>
{
EventHubClient.CreateFromConnectionString(csb.ToString());
throw new Exception("Entity path wasn't provided in the connection string and this new call was supposed to fail");
Expand Down

0 comments on commit c5a9f05

Please sign in to comment.