ServiceCollectionTest.cs 956 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // MonoTests.System.Web.Services.Description.ServiceCollectionTest.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 ServiceCollectionTest
  16. {
  17. ServiceCollection sc;
  18. [SetUp]
  19. public void InitializeServiceCollection ()
  20. {
  21. // workaround for internal constructor
  22. ServiceDescription desc = new ServiceDescription ();
  23. sc = desc.Services;
  24. }
  25. [Test]
  26. public void TestDefaultProperties()
  27. {
  28. Assertion.AssertNull (sc["hello"]);
  29. Assertion.AssertEquals (0, sc.Count);
  30. }
  31. [Test]
  32. public void TestAddService ()
  33. {
  34. const string serviceName = "testService";
  35. Service s = new Service ();
  36. s.Name = serviceName;
  37. sc.Add (s);
  38. Assertion.AssertEquals (1, sc.Count);
  39. Assertion.AssertEquals (s, sc[serviceName]);
  40. }
  41. }
  42. }