eol style
[mono.git] / mcs / class / corlib / Test / System.Security.Cryptography / AsymmetricAlgorithmTest.cs
1 //
2 // TestSuite.System.Security.Cryptography.AsymmetricAlgorithmTest.cs
3 //
4 // Author:
5 //      Thomas Neidhart (tome@sbox.tugraz.at)
6 //
7
8
9 using System;
10 using System.Security.Cryptography;
11
12 using NUnit.Framework;
13
14 namespace MonoTests.System.Security.Cryptography {
15
16         public class AsymmetricAlgorithmTest : TestCase {
17                 private AsymmetricAlgorithm _algo;
18                 protected override void SetUp() {
19                         _algo = AsymmetricAlgorithm.Create();
20                 }
21
22                 private void SetDefaultData() {
23                 }
24                 
25                 public void TestProperties() {
26                         Assert("Properties (1)", _algo != null);
27                         
28                         bool thrown = false;
29                         try {
30                                 KeySizes[] keys = _algo.LegalKeySizes;
31                                 foreach (KeySizes myKey in keys) {
32                                         for (int i=myKey.MinSize; i<=myKey.MaxSize; i+=myKey.SkipSize) {
33                                                 _algo.KeySize = i;
34                                         }
35                                 }
36                         } catch (CryptographicException) {thrown=true;}
37                         Assert("Properties (2)", !thrown);                      
38                 }
39         }
40 }