ServiceDescriptionCollectionTest.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // MonoTests.System.Web.Services.Description.ServiceDescriptionCollectionTest.cs
  3. //
  4. // Author:
  5. // Erik LeBel <[email protected]>
  6. //
  7. // (C) 2003 Erik LeBel
  8. //
  9. using NUnit.Framework;
  10. using System;
  11. using System.Web.Services.Description;
  12. namespace MonoTests.System.Web.Services.Description
  13. {
  14. [TestFixture]
  15. public class ServiceDescriptionCollectionTest
  16. {
  17. ServiceDescriptionCollection sdc;
  18. [SetUp]
  19. public void InitializeServiceDescriptionCollection ()
  20. {
  21. sdc = new ServiceDescriptionCollection ();
  22. }
  23. [Test]
  24. public void TestDefaultProperties()
  25. {
  26. Assertion.AssertNull (sdc["hello"]);
  27. Assertion.AssertEquals (0, sdc.Count);
  28. }
  29. [Test]
  30. public void TestAddServiceDescriptionWithoutTargetNS ()
  31. {
  32. const string serviceDescriptionNamespace = "testServiceDescription";
  33. ServiceDescription sd = new ServiceDescription ();
  34. sdc.Add (sd);
  35. Assertion.AssertEquals (1, sdc.Count);
  36. Assertion.AssertNull (sdc[serviceDescriptionNamespace]);
  37. }
  38. [Test]
  39. public void TestAddServiceDescriptionWithTargetNS ()
  40. {
  41. const string serviceDescriptionNamespace = "http://some.urn";
  42. ServiceDescription sd = new ServiceDescription ();
  43. sd.TargetNamespace = serviceDescriptionNamespace;
  44. sdc.Add (sd);
  45. Assertion.AssertEquals (1, sdc.Count);
  46. Assertion.AssertEquals (sd, sdc[serviceDescriptionNamespace]);
  47. }
  48. }
  49. }