Skip to content

Commit

Permalink
Adjusted the message of ArgumentException to be consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
segor committed Feb 8, 2024
1 parent a42da66 commit c167708
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SslCertBinding.Net.Tests/CertificateBindingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ public void ConstructorWithEmptyCertificateThumbprintShouldFailTest()
void constructor() => _ = new CertificateBinding(String.Empty, "MY", new IPEndPoint(0, 0), Guid.Empty);

var ex = Assert.Throws<ArgumentException>(constructor);
Assert.That(ex.Message, Does.StartWith("'certificateThumbprint' cannot be null or empty."));
Assert.That(ex.Message, Does.StartWith("Value cannot be null or empty."));
Assert.That(ex.ParamName, Is.EqualTo("certificateThumbprint"));
}

Expand Down
2 changes: 1 addition & 1 deletion src/SslCertBinding.Net/CertificateBinding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public CertificateBinding(string certificateThumbprint, StoreName certificateSto

public CertificateBinding(string certificateThumbprint, string certificateStoreName, IPEndPoint ipPort, Guid appId, BindingOptions options = default) {
if (string.IsNullOrEmpty(certificateThumbprint)) {
throw new ArgumentException($"'{nameof(certificateThumbprint)}' cannot be null or empty.", nameof(certificateThumbprint));
throw new ArgumentException($"Value cannot be null or empty.", nameof(certificateThumbprint));
}

Thumbprint = certificateThumbprint;
Expand Down

0 comments on commit c167708

Please sign in to comment.