X509ChainTest.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // X509ChainTest.cs - NUnit tests for X509Chain
  3. //
  4. // Author:
  5. // Sebastien Pouliot ([email protected])
  6. //
  7. // (C) 2003 Motus Technologies Inc. (http://www.motus.com)
  8. //
  9. #if NET_2_0
  10. using NUnit.Framework;
  11. using System;
  12. using System.Security.Cryptography.X509Certificates;
  13. namespace MonoTests.System.Security.Cryptography.X509Certificates {
  14. [TestFixture]
  15. public class X509ChainTest : Assertion {
  16. [Test]
  17. public void ConstructorEmpty ()
  18. {
  19. X509Chain c = new X509Chain ();
  20. // default properties
  21. AssertEquals ("ChainElements", 0, c.ChainElements.Count);
  22. AssertNotNull ("ChainPolicy", c.ChainPolicy);
  23. AssertEquals ("ChainStatus", 0, c.ChainStatus.Length);
  24. }
  25. [Test]
  26. public void ConstructorMachineContextFalse ()
  27. {
  28. X509Chain c = new X509Chain (false);
  29. // default properties
  30. AssertEquals ("ChainElements", 0, c.ChainElements.Count);
  31. AssertNotNull ("ChainPolicy", c.ChainPolicy);
  32. AssertEquals ("ChainStatus", 0, c.ChainStatus.Length);
  33. }
  34. [Test]
  35. public void ConstructorMachineContextTrue ()
  36. {
  37. X509Chain c = new X509Chain (true);
  38. // default properties
  39. AssertEquals ("ChainElements", 0, c.ChainElements.Count);
  40. AssertNotNull ("ChainPolicy", c.ChainPolicy);
  41. AssertEquals ("ChainStatus", 0, c.ChainStatus.Length);
  42. }
  43. [Test]
  44. public void StaticCreation ()
  45. {
  46. X509Chain c = X509Chain.Create ();
  47. // default properties
  48. AssertEquals ("ChainElements", 0, c.ChainElements.Count);
  49. AssertNotNull ("ChainPolicy", c.ChainPolicy);
  50. AssertEquals ("ChainStatus", 0, c.ChainStatus.Length);
  51. }
  52. }
  53. }
  54. #endif