AllTests.cs 1.8 KB

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