summary refs log tree commit diff
path: root/crypto/test/src/openpgp
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/test/src/openpgp')
-rw-r--r--crypto/test/src/openpgp/test/PGPArmoredTest.cs5
-rw-r--r--crypto/test/src/openpgp/test/PGPClearSignedSignatureTest.cs5
-rw-r--r--crypto/test/src/openpgp/test/PGPCompressionTest.cs7
-rw-r--r--crypto/test/src/openpgp/test/PGPDSAElGamalTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PGPDSATest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PGPNoPrivateKeyTest.cs4
-rw-r--r--crypto/test/src/openpgp/test/PGPPBETest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PGPPacketTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PGPRSATest.cs4
-rw-r--r--crypto/test/src/openpgp/test/PGPSignatureTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PgpECDHTest.cs5
-rw-r--r--crypto/test/src/openpgp/test/PgpECDsaTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PgpECMessageTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PgpFeaturesTest.cs30
-rw-r--r--crypto/test/src/openpgp/test/PgpKeyRingTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PgpMarkerTest.cs4
-rw-r--r--crypto/test/src/openpgp/test/PgpParsingTest.cs3
-rw-r--r--crypto/test/src/openpgp/test/PgpUnicodeTest.cs23
-rw-r--r--crypto/test/src/openpgp/test/RegressionTest.cs7
19 files changed, 51 insertions, 70 deletions
diff --git a/crypto/test/src/openpgp/test/PGPArmoredTest.cs b/crypto/test/src/openpgp/test/PGPArmoredTest.cs

index f78165d5a..1f1cbf3c3 100644 --- a/crypto/test/src/openpgp/test/PGPArmoredTest.cs +++ b/crypto/test/src/openpgp/test/PGPArmoredTest.cs
@@ -292,11 +292,10 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests public override string Name { - get { return "PGPArmoredTest"; } + get { return "PgpArmoredTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpArmoredTest()); } diff --git a/crypto/test/src/openpgp/test/PGPClearSignedSignatureTest.cs b/crypto/test/src/openpgp/test/PGPClearSignedSignatureTest.cs
index 668f8cce2..6ed632a00 100644 --- a/crypto/test/src/openpgp/test/PGPClearSignedSignatureTest.cs +++ b/crypto/test/src/openpgp/test/PGPClearSignedSignatureTest.cs
@@ -160,7 +160,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests public override string Name { - get { return "PGPClearSignedSignature"; } + get { return "PgpClearSignedSignatureTest"; } } private void messageTest( @@ -428,8 +428,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests generateTest(crNlMessage, "\\r\\n"); } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpClearSignedSignatureTest()); } diff --git a/crypto/test/src/openpgp/test/PGPCompressionTest.cs b/crypto/test/src/openpgp/test/PGPCompressionTest.cs
index fdcf7222c..c8bca7470 100644 --- a/crypto/test/src/openpgp/test/PGPCompressionTest.cs +++ b/crypto/test/src/openpgp/test/PGPCompressionTest.cs
@@ -4,8 +4,6 @@ using System.Text; using NUnit.Framework; -using Org.BouncyCastle.Asn1.Utilities; -using Org.BouncyCastle.Utilities; using Org.BouncyCastle.Utilities.IO; using Org.BouncyCastle.Utilities.Test; @@ -105,11 +103,10 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests public override string Name { - get { return "PGPCompressionTest"; } + get { return "PgpCompressionTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpCompressionTest()); } diff --git a/crypto/test/src/openpgp/test/PGPDSAElGamalTest.cs b/crypto/test/src/openpgp/test/PGPDSAElGamalTest.cs
index b86324954..cd10a3ffe 100644 --- a/crypto/test/src/openpgp/test/PGPDSAElGamalTest.cs +++ b/crypto/test/src/openpgp/test/PGPDSAElGamalTest.cs
@@ -1,5 +1,4 @@ using System; -using System.Collections; using System.IO; using System.Text; @@ -472,7 +471,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests public override string Name { - get { return "PGPDSAElGamalTest"; } + get { return "PgpDsaElGamalTest"; } } public static void Main( diff --git a/crypto/test/src/openpgp/test/PGPDSATest.cs b/crypto/test/src/openpgp/test/PGPDSATest.cs
index e1dc384db..b99fe2354 100644 --- a/crypto/test/src/openpgp/test/PGPDSATest.cs +++ b/crypto/test/src/openpgp/test/PGPDSATest.cs
@@ -580,8 +580,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpDsaTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpDsaTest()); } diff --git a/crypto/test/src/openpgp/test/PGPNoPrivateKeyTest.cs b/crypto/test/src/openpgp/test/PGPNoPrivateKeyTest.cs
index 222b50a4b..3006aeb3e 100644 --- a/crypto/test/src/openpgp/test/PGPNoPrivateKeyTest.cs +++ b/crypto/test/src/openpgp/test/PGPNoPrivateKeyTest.cs
@@ -1,5 +1,4 @@ using System; -using System.IO; using NUnit.Framework; @@ -152,8 +151,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpNoPrivateKeyTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpNoPrivateKeyTest()); } diff --git a/crypto/test/src/openpgp/test/PGPPBETest.cs b/crypto/test/src/openpgp/test/PGPPBETest.cs
index eee3aaa63..43016465e 100644 --- a/crypto/test/src/openpgp/test/PGPPBETest.cs +++ b/crypto/test/src/openpgp/test/PGPPBETest.cs
@@ -367,8 +367,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpPbeTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpPbeTest()); } diff --git a/crypto/test/src/openpgp/test/PGPPacketTest.cs b/crypto/test/src/openpgp/test/PGPPacketTest.cs
index b3dbbc2ed..9c5e8239f 100644 --- a/crypto/test/src/openpgp/test/PGPPacketTest.cs +++ b/crypto/test/src/openpgp/test/PGPPacketTest.cs
@@ -63,8 +63,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpPacketTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpPacketTest()); } diff --git a/crypto/test/src/openpgp/test/PGPRSATest.cs b/crypto/test/src/openpgp/test/PGPRSATest.cs
index be111c958..250fe6143 100644 --- a/crypto/test/src/openpgp/test/PGPRSATest.cs +++ b/crypto/test/src/openpgp/test/PGPRSATest.cs
@@ -7,7 +7,6 @@ using NUnit.Framework; using Org.BouncyCastle.Bcpg.Attr; using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Math; using Org.BouncyCastle.Security; @@ -1216,8 +1215,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpRsaTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpRsaTest()); } diff --git a/crypto/test/src/openpgp/test/PGPSignatureTest.cs b/crypto/test/src/openpgp/test/PGPSignatureTest.cs
index d2f4a8a31..b836fe236 100644 --- a/crypto/test/src/openpgp/test/PGPSignatureTest.cs +++ b/crypto/test/src/openpgp/test/PGPSignatureTest.cs
@@ -1069,8 +1069,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpSignatureTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpSignatureTest()); } diff --git a/crypto/test/src/openpgp/test/PgpECDHTest.cs b/crypto/test/src/openpgp/test/PgpECDHTest.cs
index b7c500bd0..94ab2a755 100644 --- a/crypto/test/src/openpgp/test/PgpECDHTest.cs +++ b/crypto/test/src/openpgp/test/PgpECDHTest.cs
@@ -6,9 +6,7 @@ using System.Text; using NUnit.Framework; using Org.BouncyCastle.Asn1.Sec; -using Org.BouncyCastle.Asn1.X9; using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Security; using Org.BouncyCastle.Utilities; @@ -263,8 +261,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpECDHTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpECDHTest()); } diff --git a/crypto/test/src/openpgp/test/PgpECDsaTest.cs b/crypto/test/src/openpgp/test/PgpECDsaTest.cs
index 6259ef627..c06532080 100644 --- a/crypto/test/src/openpgp/test/PgpECDsaTest.cs +++ b/crypto/test/src/openpgp/test/PgpECDsaTest.cs
@@ -188,8 +188,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpECDsaTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpECDsaTest()); } diff --git a/crypto/test/src/openpgp/test/PgpECMessageTest.cs b/crypto/test/src/openpgp/test/PgpECMessageTest.cs
index ac8283721..8f6111c9b 100644 --- a/crypto/test/src/openpgp/test/PgpECMessageTest.cs +++ b/crypto/test/src/openpgp/test/PgpECMessageTest.cs
@@ -179,8 +179,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpECMessageTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpECMessageTest()); } diff --git a/crypto/test/src/openpgp/test/PgpFeaturesTest.cs b/crypto/test/src/openpgp/test/PgpFeaturesTest.cs
index 2969d8982..162c3f093 100644 --- a/crypto/test/src/openpgp/test/PgpFeaturesTest.cs +++ b/crypto/test/src/openpgp/test/PgpFeaturesTest.cs
@@ -1,15 +1,17 @@ - -using NUnit.Core; +using System; + using NUnit.Framework; + using Org.BouncyCastle.Bcpg.Sig; +using Org.BouncyCastle.Utilities.Test; namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests { [TestFixture] public class PgpFeaturesTest + : SimpleTest { - [Test] - public void PerformTest() + public override void PerformTest() { Features f = new Features(true, Features.FEATURE_MODIFICATION_DETECTION); Assert.IsTrue(f.SupportsFeature(Features.FEATURE_MODIFICATION_DETECTION)); @@ -36,20 +38,22 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests Assert.IsTrue(f.SupportsFeature(Features.FEATURE_VERSION_5_PUBLIC_KEY)); } + public override string Name + { + get { return "PgpFeaturesTest"; } + } + public static void Main(string[] args) { - Suite.Run(new NullListener(), NUnit.Core.TestFilter.Empty); + RunTest(new PgpFeaturesTest()); } - [Suite] - public static TestSuite Suite + [Test] + public void TestFunction() { - get - { - TestSuite suite = new TestSuite("PGP Features Tests"); - suite.Add(new PgpFeaturesTest()); - return suite; - } + string resultText = Perform().ToString(); + + Assert.AreEqual(Name + ": Okay", resultText); } } } diff --git a/crypto/test/src/openpgp/test/PgpKeyRingTest.cs b/crypto/test/src/openpgp/test/PgpKeyRingTest.cs
index aed750318..f8eaa648d 100644 --- a/crypto/test/src/openpgp/test/PgpKeyRingTest.cs +++ b/crypto/test/src/openpgp/test/PgpKeyRingTest.cs
@@ -2654,8 +2654,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpKeyRingTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpKeyRingTest()); } diff --git a/crypto/test/src/openpgp/test/PgpMarkerTest.cs b/crypto/test/src/openpgp/test/PgpMarkerTest.cs
index 89be7cd52..929be6d73 100644 --- a/crypto/test/src/openpgp/test/PgpMarkerTest.cs +++ b/crypto/test/src/openpgp/test/PgpMarkerTest.cs
@@ -1,5 +1,4 @@ using System; -using System.IO; using NUnit.Framework; @@ -85,8 +84,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpMarkerTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpMarkerTest()); } diff --git a/crypto/test/src/openpgp/test/PgpParsingTest.cs b/crypto/test/src/openpgp/test/PgpParsingTest.cs
index 78fca7570..6a5688484 100644 --- a/crypto/test/src/openpgp/test/PgpParsingTest.cs +++ b/crypto/test/src/openpgp/test/PgpParsingTest.cs
@@ -23,8 +23,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests get { return "PgpParsingTest"; } } - public static void Main( - string[] args) + public static void Main(string[] args) { RunTest(new PgpParsingTest()); } diff --git a/crypto/test/src/openpgp/test/PgpUnicodeTest.cs b/crypto/test/src/openpgp/test/PgpUnicodeTest.cs
index 534e8a471..d73e3d7a6 100644 --- a/crypto/test/src/openpgp/test/PgpUnicodeTest.cs +++ b/crypto/test/src/openpgp/test/PgpUnicodeTest.cs
@@ -2,7 +2,6 @@ using System.IO; using System.Text; -using NUnit.Core; using NUnit.Framework; using Org.BouncyCastle.Math; @@ -12,6 +11,7 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests { [TestFixture] public class PgpUnicodeTest + : SimpleTest { private void DoTestKey(BigInteger keyId, string passphrase, bool utf8) { @@ -123,20 +123,21 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests return new PgpSecretKeyRingBundle(SimpleTest.GetTestDataAsStream("openpgp.unicode." + keyName)); } - public static void Main(string[] args) + public override string Name { - Suite.Run(new NullListener(), NUnit.Core.TestFilter.Empty); + get { return "PgpUnicodeTest"; } } - [Suite] - public static TestSuite Suite + public override void PerformTest() { - get - { - TestSuite suite = new TestSuite("Unicode Password Tests"); - suite.Add(new PgpUnicodeTest()); - return suite; - } + TestAsciiPassphrase(); + TestCyrillicPassphrase(); + TestUmlautPassphrase(); + } + + public static void Main(string[] args) + { + RunTest(new PgpUnicodeTest()); } } } diff --git a/crypto/test/src/openpgp/test/RegressionTest.cs b/crypto/test/src/openpgp/test/RegressionTest.cs
index 329960bd8..5e978f0ea 100644 --- a/crypto/test/src/openpgp/test/RegressionTest.cs +++ b/crypto/test/src/openpgp/test/RegressionTest.cs
@@ -24,15 +24,14 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests new PgpECDsaTest(), new PgpECMessageTest(), new PgpParsingTest(), + new PgpFeaturesTest(), }; - public static void Main( - string[] args) + public static void Main(string[] args) { foreach (ITest test in tests) { - ITestResult result = test.Perform(); - Console.WriteLine(result); + SimpleTest.RunTest(test); } } }