diff options
author | Peter Dettman <peter.dettman@gmail.com> | 2022-06-23 01:24:31 +0700 |
---|---|---|
committer | Peter Dettman <peter.dettman@gmail.com> | 2022-06-23 01:24:31 +0700 |
commit | 99affc58acf520f25ac7365ad6bb895da8c04a0a (patch) | |
tree | 4c85ff5e1009a652cc2971ccdc4083e0dfede805 /crypto/test/src | |
parent | Remove Main methods from test classes (diff) | |
download | BouncyCastle.NET-ed25519-99affc58acf520f25ac7365ad6bb895da8c04a0a.tar.xz |
Cleanup redundant test classes
Diffstat (limited to 'crypto/test/src')
-rw-r--r-- | crypto/test/src/asn1/test/AllTests.cs | 27 | ||||
-rw-r--r-- | crypto/test/src/asn1/test/RegressionTest.cs | 79 | ||||
-rw-r--r-- | crypto/test/src/cms/test/AllTests.cs | 31 | ||||
-rw-r--r-- | crypto/test/src/crypto/agreement/test/AllTests.cs | 28 | ||||
-rw-r--r-- | crypto/test/src/crypto/io/test/AllTests.cs | 23 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/AllTests.cs | 43 | ||||
-rw-r--r-- | crypto/test/src/crypto/test/RegressionTest.cs | 155 | ||||
-rw-r--r-- | crypto/test/src/math/ec/test/AllTests.cs | 25 | ||||
-rw-r--r-- | crypto/test/src/math/test/AllTests.cs | 24 | ||||
-rw-r--r-- | crypto/test/src/ocsp/test/AllTests.cs | 25 | ||||
-rw-r--r-- | crypto/test/src/openpgp/examples/test/AllTests.cs | 14 | ||||
-rw-r--r-- | crypto/test/src/openpgp/test/RegressionTest.cs | 33 | ||||
-rw-r--r-- | crypto/test/src/openssl/test/AllTests.cs | 39 | ||||
-rw-r--r-- | crypto/test/src/test/RegressionTest.cs | 71 | ||||
-rw-r--r-- | crypto/test/src/tsp/test/AllTests.cs | 26 | ||||
-rw-r--r-- | crypto/test/src/util/io/pem/test/AllTests.cs | 43 |
16 files changed, 13 insertions, 673 deletions
diff --git a/crypto/test/src/asn1/test/AllTests.cs b/crypto/test/src/asn1/test/AllTests.cs deleted file mode 100644 index 80ca9500f..000000000 --- a/crypto/test/src/asn1/test/AllTests.cs +++ /dev/null @@ -1,27 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -namespace Org.BouncyCastle.Asn1.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("ASN.1 tests"); - // TODO Add these tests to RegressionTest list - suite.Add(new Asn1SequenceParserTest()); - suite.Add(new OctetStringTest()); - suite.Add(new ParseTest()); - suite.Add(new TimeTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/asn1/test/RegressionTest.cs b/crypto/test/src/asn1/test/RegressionTest.cs deleted file mode 100644 index ed2560fb9..000000000 --- a/crypto/test/src/asn1/test/RegressionTest.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Asn1.Tests -{ - public class RegressionTest - { - public static readonly ITest[] tests = - { - new AdditionalInformationSyntaxUnitTest(), - new AdmissionSyntaxUnitTest(), - new AdmissionsUnitTest(), - new Asn1IntegerTest(), - new AttributeTableUnitTest(), - new BiometricDataUnitTest(), - new BitStringTest(), - new CertHashUnitTest(), - new CertificateTest(), - new CmsTest(), - new CommitmentTypeIndicationUnitTest(), - new CommitmentTypeQualifierUnitTest(), - new ContentHintsUnitTest(), - new CscaMasterListTest(), - new DataGroupHashUnitTest(), - new DeclarationOfMajorityUnitTest(), - new DerUtf8StringTest(), - new EncryptedPrivateKeyInfoTest(), - new EqualsAndHashCodeTest(), - new EssCertIDv2UnitTest(), - new GeneralizedTimeTest(), - new GeneralNameTest(), - new GenerationTest(), - new InputStreamTest(), - new Iso4217CurrencyCodeUnitTest(), - new IssuingDistributionPointUnitTest(), - new KeyUsageTest(), - new LDSSecurityObjectUnitTest(), - new LinkedCertificateTest(), - new MiscTest(), - new MonetaryLimitUnitTest(), - new MonetaryValueUnitTest(), - new NameOrPseudonymUnitTest(), - new NamingAuthorityUnitTest(), - new NetscapeCertTypeTest(), - new OcspTest(), - new OidTest(), - new OtherCertIDUnitTest(), - new OtherSigningCertificateUnitTest(), - new ParsingTest(), - new PersonalDataUnitTest(), - new Pkcs10Test(), - new Pkcs12Test(), - new PkiFailureInfoTest(), - new PrivateKeyInfoTest(), - new ProcurationSyntaxUnitTest(), - new ProfessionInfoUnitTest(), - new QCStatementUnitTest(), - new ReasonFlagsTest(), - new RelativeOidTest(), - new RequestedCertificateUnitTest(), - new RestrictionUnitTest(), - new SemanticsInformationUnitTest(), - new SetTest(), - new SignerLocationUnitTest(), - new SmimeTest(), - new StringTest(), - new SubjectKeyIdentifierTest(), - new TagTest(), - new TargetInformationTest(), - new TypeOfBiometricDataUnitTest(), - new UtcTimeTest(), - new X509ExtensionsTest(), - new X509NameTest(), - new X9Test(), - new KMacParamsTest() - }; - } -} diff --git a/crypto/test/src/cms/test/AllTests.cs b/crypto/test/src/cms/test/AllTests.cs deleted file mode 100644 index e1deae0f0..000000000 --- a/crypto/test/src/cms/test/AllTests.cs +++ /dev/null @@ -1,31 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; -using Org.BouncyCastle.Asn1.Tests; -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Cms.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("CMS Tests"); - suite.Add(new CompressedDataTest()); - suite.Add(new CompressedDataStreamTest()); - suite.Add(new EnvelopedDataTest()); - suite.Add(new EnvelopedDataStreamTest()); - suite.Add(new Rfc4134Test()); - suite.Add(new SignedDataTest()); - suite.Add(new SignedDataStreamTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/crypto/agreement/test/AllTests.cs b/crypto/test/src/crypto/agreement/test/AllTests.cs deleted file mode 100644 index 4de240660..000000000 --- a/crypto/test/src/crypto/agreement/test/AllTests.cs +++ /dev/null @@ -1,28 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Crypto.Agreement.Tests -{ - [TestFixture] - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("JPAKE Engine Tests"); - suite.Add(new JPakeParticipantTest()); - suite.Add(new JPakePrimeOrderGroupTest()); - suite.Add(new JPakeUtilitiesTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/crypto/io/test/AllTests.cs b/crypto/test/src/crypto/io/test/AllTests.cs deleted file mode 100644 index 821b11c2f..000000000 --- a/crypto/test/src/crypto/io/test/AllTests.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -namespace Org.BouncyCastle.Crypto.IO.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("IO tests"); - suite.Add(new CipherStreamTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/crypto/test/AllTests.cs b/crypto/test/src/crypto/test/AllTests.cs deleted file mode 100644 index b7d8ea254..000000000 --- a/crypto/test/src/crypto/test/AllTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; - -#if !LIB -using NUnit.Core; -#endif -using NUnit.Framework; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Crypto.Tests -{ - [TestFixture] - public class AllTests - { -#if !LIB - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("Lightweight Crypto Tests"); - suite.Add(new AllTests()); - suite.Add(new GcmReorderTest()); - return suite; - } - } -#endif - - [Test] - public void TestCrypto() - { - foreach (Org.BouncyCastle.Utilities.Test.ITest test in RegressionTest.tests) - { - SimpleTestResult result = (SimpleTestResult)test.Perform(); - - if (!result.IsSuccessful()) - { - Assert.Fail(result.ToString()); - } - } - } - } -} diff --git a/crypto/test/src/crypto/test/RegressionTest.cs b/crypto/test/src/crypto/test/RegressionTest.cs deleted file mode 100644 index eeb078397..000000000 --- a/crypto/test/src/crypto/test/RegressionTest.cs +++ /dev/null @@ -1,155 +0,0 @@ -using System; - -using Org.BouncyCastle.Crypto.Tests.Cavp; -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Crypto.Tests -{ - public class RegressionTest - { - public static ITest[] tests = new ITest[] - { - new AesTest(), - new AesLightTest(), - new AesWrapTest(), - new AriaTest(), - new DesTest(), - new DesEdeTest(), - new ModeTest(), - new PaddingTest(), - new DHTest(), - new ElGamalTest(), - new DsaTest(), - new ECTest(), - new DeterministicDsaTest(), - new Gost3410Test(), - new ECGost3410Test(), - new ECGost3410_2012Test(), - new EcIesTest(), - new EcNrTest(), - new MacTest(), - new Gost28147MacTest(), - new RC2Test(), - new RC2WrapTest(), - new RC4Test(), - new RC5Test(), - new RC6Test(), - new RijndaelTest(), - new SerpentTest(), - new TnepresTest(), - new CamelliaTest(), - new CamelliaLightTest(), - new DigestRandomNumberTest(), - new SkipjackTest(), - new BlowfishTest(), - new TwofishTest(), - new Threefish256Test(), - new Threefish512Test(), - new Threefish1024Test(), - new SkeinDigestTest(), - new SkeinMacTest(), - new Cast5Test(), - new Cast6Test(), - new Gost28147Test(), - new IdeaTest(), - new RsaBlindedTest(), - new RsaTest(), - new ISO9796Test(), - new ISO9797Alg3MacTest(), - new MD2DigestTest(), - new MD4DigestTest(), - new MD5DigestTest(), - new PssBlindTest(), - new Sha1DigestTest(), - new Sha224DigestTest(), - new Sha256DigestTest(), - new Sha384DigestTest(), - new Sha512DigestTest(), - new Sha512t224DigestTest(), - new Sha512t256DigestTest(), - new Sha3DigestTest(), - new RipeMD128DigestTest(), - new RipeMD160DigestTest(), - new RipeMD256DigestTest(), - new RipeMD320DigestTest(), - new TigerDigestTest(), - new Gost3411DigestTest(), - new WhirlpoolDigestTest(), - new MD5HMacTest(), - new Sha1HMacTest(), - new Sha224HMacTest(), - new Sha256HMacTest(), - new Sha384HMacTest(), - new Sha512HMacTest(), - new RipeMD128HMacTest(), - new RipeMD160HMacTest(), - new OaepTest(), - new PssTest(), - new CTSTest(), - new CcmTest(), - new Pkcs5Test(), - new Pkcs12Test(), - new Kdf1GeneratorTest(), - new Kdf2GeneratorTest(), - new Mgf1GeneratorTest(), - new HkdfGeneratorTest(), - new DHKekGeneratorTest(), - new ECDHKekGeneratorTest(), - new ShortenedDigestTest(), - new EqualsHashCodeTest(), - new TeaTest(), - new XteaTest(), - new Rfc3211WrapTest(), - new SeedTest(), - new NaccacheSternTest(), - new Salsa20Test(), - new XSalsa20Test(), - new ChaChaTest(), - new ChaCha20Poly1305Test(), - new CMacTest(), - new EaxTest(), - new GcmTest(), - new GMacTest(), - new HCFamilyTest(), - new HCFamilyVecTest(), - new IsaacTest(), - new NoekeonTest(), - new VmpcKsa3Test(), - new VmpcMacTest(), - new VmpcTest(), - new Srp6Test(), - new SCryptTest(), - new NullTest(), - new SipHashTest(), - new Poly1305Test(), - new OcbTest(), - new NonMemoableDigestTest(), - new StreamCipherResetTest(), - new SM3DigestTest(), - new BCryptTest(), - new OpenBsdBCryptTest(), - new X931SignerTest(), - new Blake2bDigestTest(), - new Blake2sDigestTest(), - new KeccakDigestTest(), - new ShakeDigestTest(), - new SM2EngineTest(), - new SM2KeyExchangeTest(), - new SM2SignerTest(), - new SM4Test(), - new X25519Test(), - new X448Test(), - new Ed25519Test(), - new Ed448Test(), - new KdfCounterTests(), - new KdfDoublePipelineTests(), - new KdfFeedbackCounterTests(), - new CShakeTest(), - new KMacTest(), - new GcmSivTest(), - new ParallelHashTest(), - new SP80038GTest(), - new TupleHashTest(), - }; - } -} diff --git a/crypto/test/src/math/ec/test/AllTests.cs b/crypto/test/src/math/ec/test/AllTests.cs deleted file mode 100644 index 7fdb77d07..000000000 --- a/crypto/test/src/math/ec/test/AllTests.cs +++ /dev/null @@ -1,25 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -namespace Org.BouncyCastle.Math.EC.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("EC Math tests"); - suite.Add(new ECAlgorithmsTest()); - suite.Add(new ECPointTest()); - suite.Add(new FixedPointTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/math/test/AllTests.cs b/crypto/test/src/math/test/AllTests.cs deleted file mode 100644 index 087fe0a29..000000000 --- a/crypto/test/src/math/test/AllTests.cs +++ /dev/null @@ -1,24 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -namespace Org.BouncyCastle.Math.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("Math tests"); - suite.Add(new BigIntegerTest()); - suite.Add(new PrimesTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/ocsp/test/AllTests.cs b/crypto/test/src/ocsp/test/AllTests.cs deleted file mode 100644 index 05816e481..000000000 --- a/crypto/test/src/ocsp/test/AllTests.cs +++ /dev/null @@ -1,25 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Ocsp.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("OCSP Tests"); - suite.Add(new OcspTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/openpgp/examples/test/AllTests.cs b/crypto/test/src/openpgp/examples/test/AllTests.cs index 809870cb5..c85760c18 100644 --- a/crypto/test/src/openpgp/examples/test/AllTests.cs +++ b/crypto/test/src/openpgp/examples/test/AllTests.cs @@ -1,8 +1,6 @@ -#if !LIB using System; using System.IO; -using NUnit.Core; using NUnit.Framework; using Org.BouncyCastle.Utilities; @@ -417,17 +415,5 @@ namespace Org.BouncyCastle.Bcpg.OpenPgp.Examples.Tests outStr.SetLength(0); return bRd.ReadLine(); } - - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("OpenPGP Example Tests"); - suite.Add(new AllTests()); - return suite; - } - } } } -#endif diff --git a/crypto/test/src/openpgp/test/RegressionTest.cs b/crypto/test/src/openpgp/test/RegressionTest.cs deleted file mode 100644 index 65c40b3f9..000000000 --- a/crypto/test/src/openpgp/test/RegressionTest.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Bcpg.OpenPgp.Tests -{ - public class RegressionTest - { - public static ITest[] tests = - { - new ArmoredInputStreamTest(), - new IgnoreMarkerPacketInCertificatesTest(), - new PgpArmoredTest(), - new PgpClearSignedSignatureTest(), - new PgpCompressionTest(), - new PgpDsaElGamalTest(), - new PgpDsaTest(), - new PgpECDHTest(), - new PgpECDsaTest(), - new PgpECMessageTest(), - new PgpFeaturesTest(), - new PgpKeyRingTest(), - new PgpMarkerTest(), - new PgpNoPrivateKeyTest(), - new PgpPacketTest(), - new PgpParsingTest(), - new PgpPbeTest(), - new PgpRsaTest(), - new PgpSignatureInvalidVersionIgnoredTest(), - new PgpSignatureTest(), - }; - } -} diff --git a/crypto/test/src/openssl/test/AllTests.cs b/crypto/test/src/openssl/test/AllTests.cs index a4dd890b8..c6416f9db 100644 --- a/crypto/test/src/openssl/test/AllTests.cs +++ b/crypto/test/src/openssl/test/AllTests.cs @@ -1,17 +1,10 @@ using System; using System.IO; -using System.Text; -#if !LIB -using NUnit.Core; -#endif using NUnit.Framework; using Org.BouncyCastle.Crypto; -using Org.BouncyCastle.Crypto.Generators; -using Org.BouncyCastle.Crypto.Parameters; using Org.BouncyCastle.Security; -using Org.BouncyCastle.Utilities.Test; namespace Org.BouncyCastle.OpenSsl.Tests { @@ -35,38 +28,6 @@ namespace Org.BouncyCastle.OpenSsl.Tests } } -#if !LIB - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("OpenSSL Tests"); - suite.Add(new AllTests()); - return suite; - } - } -#endif - - [Test] - public void TestOpenSsl() - { - Org.BouncyCastle.Utilities.Test.ITest[] tests = new Org.BouncyCastle.Utilities.Test.ITest[]{ - new ReaderTest(), - new WriterTest() - }; - - foreach (Org.BouncyCastle.Utilities.Test.ITest test in tests) - { - SimpleTestResult result = (SimpleTestResult)test.Perform(); - - if (!result.IsSuccessful()) - { - Assert.Fail(result.ToString()); - } - } - } - [Test] public void TestPkcs8Encrypted() { diff --git a/crypto/test/src/test/RegressionTest.cs b/crypto/test/src/test/RegressionTest.cs deleted file mode 100644 index 618f8f483..000000000 --- a/crypto/test/src/test/RegressionTest.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; - -using Org.BouncyCastle.Utilities.Test; - -namespace Org.BouncyCastle.Tests -{ - public class RegressionTest - { - // These tests were ported from org.bouncycastle.jce.provider.test in Java build - public static ITest[] tests = new ITest[] - { - new FipsDesTest(), - new DesEdeTest(), - new AesTest(), - new CamelliaTest(), - new SeedTest(), - new AesSicTest(), - new Gost28147Test(), - new PbeTest(), - new BlockCipherTest(), - new MacTest(), - new HMacTest(), -// new SealedTest(), - new RsaTest(), - new DHTest(), - new DsaTest(), -// new ImplicitlyCaTest(), - new ECNRTest(), - new ECDsa5Test(), - new Gost3410Test(), - new ElGamalTest(), - new IesTest(), - new SigTest(), - new AttrCertTest(), - new CertTest(), - new Pkcs10CertRequestTest(), - new EncryptedPrivateKeyInfoTest(), // Also in Org.BouncyCastle.Pkcs.Tests -// new KeyStoreTest(), -// new Pkcs12StoreTest(), // Already in Org.BouncyCastle.Pkcs.Tests - new DigestTest(), - new PssTest(), - new WrapTest(), -// new DoFinalTest(), - new CipherStreamTest(), - new NamedCurveTest(), - new PkixTest(), -// new NetscapeCertRequestTest(), - new X509StoreTest(), -// new X509StreamParserTest(), - new X509CertificatePairTest(), - new CertPathTest(), -// new CertStoreTest(), - new CertPathValidatorTest(), - new CertPathBuilderTest(), - new ECEncodingTest(), -// new AlgorithmParametersTest(), - new NistCertPathTest(), - new PkixPolicyMappingTest(), -// new SlotTwoTest(), - new PkixNameConstraintsTest(), - new NoekeonTest(), - new AttrCertSelectorTest(), -// new SerialisationTest(), - new MqvTest(), - new CMacTest(), - new Crl5Test(), - new SM4Test(), - new KdfCounterTest() - }; - } -} diff --git a/crypto/test/src/tsp/test/AllTests.cs b/crypto/test/src/tsp/test/AllTests.cs deleted file mode 100644 index 3733c3adc..000000000 --- a/crypto/test/src/tsp/test/AllTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -#if !LIB -using System; - -using NUnit.Core; -using NUnit.Framework; - -namespace Org.BouncyCastle.Tsp.Tests -{ - public class AllTests - { - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("TSP Tests"); - suite.Add(new GenTimeAccuracyUnitTest()); - suite.Add(new ParseTest()); - suite.Add(new TimeStampTokenInfoUnitTest()); - suite.Add(new TspTest()); - return suite; - } - } - } -} -#endif diff --git a/crypto/test/src/util/io/pem/test/AllTests.cs b/crypto/test/src/util/io/pem/test/AllTests.cs index b6d1ef2f3..9a413450d 100644 --- a/crypto/test/src/util/io/pem/test/AllTests.cs +++ b/crypto/test/src/util/io/pem/test/AllTests.cs @@ -2,9 +2,6 @@ using System; using System.Collections; using System.IO; -#if !LIB -using NUnit.Core; -#endif using NUnit.Framework; namespace Org.BouncyCastle.Utilities.IO.Pem.Tests @@ -12,41 +9,28 @@ namespace Org.BouncyCastle.Utilities.IO.Pem.Tests [TestFixture] public class AllTests { -#if !LIB - [Suite] - public static TestSuite Suite - { - get - { - TestSuite suite = new TestSuite("PEM Utilities Tests"); - suite.Add(new AllTests()); - return suite; - } - } -#endif - [Test] public void TestPemLength() { for (int i = 1; i != 60; i++) { - lengthTest("CERTIFICATE", new ArrayList(), new byte[i]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[i]); } - lengthTest("CERTIFICATE", new ArrayList(), new byte[100]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[101]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[102]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[103]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[100]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[101]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[102]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[103]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[1000]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[1001]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[1002]); - lengthTest("CERTIFICATE", new ArrayList(), new byte[1003]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[1000]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[1001]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[1002]); + LengthTest("CERTIFICATE", new ArrayList(), new byte[1003]); IList headers = new ArrayList(); headers.Add(new PemHeader("Proc-Type", "4,ENCRYPTED")); headers.Add(new PemHeader("DEK-Info", "DES3,0001020304050607")); - lengthTest("RSA PRIVATE KEY", headers, new byte[103]); + LengthTest("RSA PRIVATE KEY", headers, new byte[103]); } [Test] @@ -57,15 +41,14 @@ namespace Org.BouncyCastle.Utilities.IO.Pem.Tests PemReader rd = new PemReader(new StringReader("-----BEGIN \n")); rd.ReadPemObject(); Assert.Fail("must fail on malformed"); - } catch (IOException ioex) + } + catch (IOException ioex) { Assert.AreEqual("ran out of data before consuming type", ioex.Message); } - - } - private void lengthTest(string type, IList headers, byte[] data) + private void LengthTest(string type, IList headers, byte[] data) { StringWriter sw = new StringWriter(); PemWriter pWrt = new PemWriter(sw); |