45ff7bd5a7480fe8e2ee75f053d0b75caa8d5d64
[mono.git] / mcs / class / System.Security / Test / System.Security.Cryptography.Xml / AllTests.cs
1 //
2 // TestSuite.System.Security.Cryptography.Xml.AllTests.cs
3 //
4 // Author:
5 //      Sebastien Pouliot (spouliot@motus.com)
6 //
7 // (C) 2002 Motus Technologies Inc. (http://www.motus.com)
8 //
9
10 using System;
11 using System.Security.Cryptography;
12 using NUnit.Framework;
13
14 namespace MonoTests.System.Security.Cryptography.Xml {
15
16 public class AllTests : TestCase {
17
18         public AllTests (string name) : base (name) {}
19         
20         // because most crypto stuff works with byte[] buffers
21         static public void AssertEquals (string msg, byte[] array1, byte[] array2) 
22         {
23                 if ((array1 == null) && (array2 == null))
24                         return;
25                 if (array1 == null)
26                         Fail (msg + " -> First array is NULL");
27                 if (array2 == null)
28                         Fail (msg + " -> Second array is NULL");
29
30                 bool a = (array1.Length == array2.Length);
31                 if (a) {
32                         for (int i = 0; i < array1.Length; i++) {
33                                 if (array1 [i] != array2 [i]) {
34                                         a = false;
35                                         break;
36                                 }
37                         }
38                 }
39                 msg += " -> Expected " + BitConverter.ToString (array1, 0);
40                 msg += " is different than " + BitConverter.ToString (array2, 0);
41                 Assert (msg, a);
42         }
43
44         public static ITest Suite { 
45                 get {
46                         TestSuite suite =  new TestSuite ();
47                         suite.AddTest (DataObjectTest.Suite);
48                         suite.AddTest (DSAKeyValueTest.Suite);
49                         suite.AddTest (KeyInfoNameTest.Suite);
50                         suite.AddTest (KeyInfoNodeTest.Suite);
51                         suite.AddTest (KeyInfoRetrievalMethodTest.Suite);
52                         suite.AddTest (KeyInfoTest.Suite);
53                         suite.AddTest (KeyInfoX509DataTest.Suite);
54                         suite.AddTest (ReferenceTest.Suite);
55                         suite.AddTest (RSAKeyValueTest.Suite);
56                         suite.AddTest (SignatureTest.Suite);
57                         suite.AddTest (SignedInfoTest.Suite);
58                         suite.AddTest (SignedXmlTest.Suite);
59                         suite.AddTest (TransformChainTest.Suite);
60                         suite.AddTest (XmlDsigBase64TransformTest.Suite);
61                         suite.AddTest (XmlDsigXsltTransformTest.Suite);
62                         return suite;
63                 }
64         }
65 }
66 }