2 // TestSuite.System.Security.Cryptography.AsymmetricAlgorithmTest.cs
\r
5 // Thomas Neidhart (tome@sbox.tugraz.at)
\r
10 using System.Security.Cryptography;
\r
12 using NUnit.Framework;
\r
14 namespace MonoTests.System.Security.Cryptography {
\r
16 public class AsymmetricAlgorithmTest : TestCase {
\r
17 private AsymmetricAlgorithm _algo;
\r
19 public AsymmetricAlgorithmTest() : base ("MonoTests.System.Security.Cryptography.AsymmetricAlgorithmTest testcase") {
\r
22 public AsymmetricAlgorithmTest(String name) : base(name) {
\r
26 public static ITest Suite {
\r
28 return new TestSuite(typeof(AsymmetricAlgorithmTest));
\r
32 protected override void SetUp() {
\r
33 _algo = AsymmetricAlgorithm.Create();
\r
36 private void SetDefaultData() {
\r
39 public void TestProperties() {
\r
40 Assert("Properties (1)", _algo != null);
\r
42 bool thrown = false;
\r
44 KeySizes[] keys = _algo.LegalKeySizes;
\r
45 foreach (KeySizes myKey in keys) {
\r
46 for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
\r
50 } catch (CryptographicException) {thrown=true;}
\r
51 Assert("Properties (2)", !thrown);
\r