BindingCollectionTest.cs 956 B

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