diff options
author | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-06 23:46:28 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@bouncycastle.org> | 2020-04-06 23:46:28 +0700 |
commit | b305fec4312575143dc8c83bea6ab65e0cb03f26 (patch) | |
tree | 0c1b9c6095fcfead5630b407d4782772c7cd7dcb /crypto | |
parent | Add OtherName support and refactoring (diff) | |
download | BouncyCastle.NET-ed25519-b305fec4312575143dc8c83bea6ab65e0cb03f26.tar.xz |
Newer .NET versions append the parameter name
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/test/src/asn1/test/ASN1IntegerTest.cs | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/crypto/test/src/asn1/test/ASN1IntegerTest.cs b/crypto/test/src/asn1/test/ASN1IntegerTest.cs index 35366ea96..689a60ac5 100644 --- a/crypto/test/src/asn1/test/ASN1IntegerTest.cs +++ b/crypto/test/src/asn1/test/ASN1IntegerTest.cs @@ -60,7 +60,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } // No support for thread-local override in C# version @@ -78,7 +78,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("test 1", "failed to construct sequence from byte[]: corrupted stream detected", e.Message); + CheckArgumentException("test 1", e, "failed to construct sequence from byte[]: corrupted stream detected"); } try @@ -89,7 +89,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } try @@ -100,7 +100,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed enumerated", e.Message); + CheckArgumentException(e, "malformed enumerated"); } try @@ -111,7 +111,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed enumerated", e.Message); + CheckArgumentException(e, "malformed enumerated"); } #endif } @@ -173,7 +173,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } @@ -189,7 +189,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } @@ -209,7 +209,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } @@ -228,7 +228,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } @@ -251,7 +251,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } @@ -270,7 +270,7 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } */ @@ -336,9 +336,18 @@ namespace Org.BouncyCastle.Asn1.Tests } catch (ArgumentException e) { - IsEquals("malformed integer", e.Message); + CheckArgumentException(e, "malformed integer"); } } + private void CheckArgumentException(ArgumentException e, String expectedMessage) + { + IsTrue(e.Message.StartsWith(expectedMessage)); + } + + private void CheckArgumentException(String errorText, ArgumentException e, String expectedMessage) + { + IsTrue(errorText, e.Message.StartsWith(expectedMessage)); + } private void SetAllowUnsafeProperty(bool allowUnsafe) { |