Fixed stupid typo. Test should now work.
[mono.git] / mcs / class / corlib / Test / System.Security.Cryptography / RNGCryptoServiceProviderTest.cs
1 //\r
2 // TestSuite.System.Security.Cryptography.RNGCryptoServiceProviderTest.cs\r
3 //\r
4 // Author:\r
5 //      Mark Crichton (crichton@gimp.org)\r
6 //\r
7 \r
8 \r
9 using System;\r
10 using System.Security.Cryptography;\r
11 \r
12 using NUnit.Framework;\r
13 \r
14 namespace MonoTests.System.Security.Cryptography {\r
15 \r
16         public class RNGCryptoServiceProviderTest : TestCase {\r
17                 private RNGCryptoServiceProvider _algo;\r
18                 \r
19                 public RNGCryptoServiceProviderTest(String name) : base(name) {\r
20                         _algo = null;\r
21                 }\r
22                 \r
23                 public static ITest Suite {\r
24                         get {\r
25                                 return new TestSuite(typeof(RNGCryptoServiceProviderTest));\r
26                         }\r
27                 }\r
28 \r
29                 protected override void SetUp() {\r
30                         _algo = new RNGCryptoServiceProvider();\r
31                 }\r
32 \r
33                 private void SetDefaultData() {\r
34                 }\r
35                 \r
36                 public void TestProperties() {\r
37                         Assert("Properties (1)", _algo != null);\r
38                         \r
39                         byte[] random = new Byte[25];\r
40 \r
41                         // The C code doesn't throw an exception yet.\r
42                         _algo.GetBytes(random);\r
43                         \r
44                         // This one we can check...\r
45                         _algo.GetNonZeroBytes(random);\r
46                         \r
47                         foreach (Byte rnd_byte in random) {\r
48                                 Assert("Properties (2)", rnd_byte != 0);\r
49                         }\r
50                 }\r
51         }\r
52 }\r