AllTests.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // MonoTests.System.Reflection.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.Reflection;
  11. using NUnit.Framework;
  12. namespace MonoTests.System.Reflection {
  13. public class RTests : 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 (AssemblyNameTest.Suite);
  41. suite.AddTest (StrongNameKeyPairTest.Suite);
  42. return suite;
  43. }
  44. }
  45. }
  46. }