ServiceDescriptionFormatExtensionCollectionTest.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // ServiceDescriptionFormatExtensionCollectionTest.cs
  3. //
  4. // Author:
  5. // Atsushi Enomoto <[email protected]>
  6. //
  7. // (C) 2006 Novell, Inc.
  8. //
  9. using NUnit.Framework;
  10. using System;
  11. using System.Web.Services.Description;
  12. using System.Xml;
  13. namespace MonoTests.System.Web.Services.Description
  14. {
  15. [TestFixture]
  16. public class ServiceDescriptionFormatExtensionCollectionTest
  17. {
  18. [Test]
  19. [ExpectedException (typeof (ArgumentException))]
  20. public void Add ()
  21. {
  22. ServiceDescriptionFormatExtensionCollection c =
  23. new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
  24. c.Add (0);
  25. }
  26. [Test]
  27. public void Add2 ()
  28. {
  29. ServiceDescriptionFormatExtensionCollection c =
  30. new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
  31. c.Add (new XmlDocument ().CreateElement ("foo"));
  32. }
  33. class MySoapBinding : SoapBinding
  34. {
  35. }
  36. [Test]
  37. public void Find ()
  38. {
  39. ServiceDescriptionFormatExtensionCollection c =
  40. new ServiceDescriptionFormatExtensionCollection (new ServiceDescription ());
  41. c.Add (new MySoapBinding ());
  42. Assert.IsNotNull (c.Find (typeof (SoapBinding)));
  43. }
  44. }
  45. }