WebHttpBindingTest.cs 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System.ServiceModel;
  2. using System.ServiceModel.Channels;
  3. using System.Text;
  4. using NUnit.Framework;
  5. namespace MonoTests.System.ServiceModel
  6. {
  7. [TestFixture]
  8. public class WebHttpBindingTest
  9. {
  10. [Test]
  11. public void DefaultPropertyValues ()
  12. {
  13. WebHttpBinding b = new WebHttpBinding ();
  14. Assert.AreEqual (EnvelopeVersion.None, b.EnvelopeVersion, "#1");
  15. Assert.AreEqual ("http", b.Scheme, "#1");
  16. Assert.AreEqual (Encoding.UTF8, b.WriteEncoding, "#2");
  17. Assert.AreEqual (0x10000, b.MaxBufferSize, "#3");
  18. #if !MOBILE
  19. Assert.AreEqual (0x80000, b.MaxBufferPoolSize, "#4");
  20. #endif
  21. Assert.AreEqual (0x10000, b.MaxReceivedMessageSize, "#5");
  22. Assert.IsFalse (((IBindingRuntimePreferences) b).ReceiveSynchronously, "#6");
  23. }
  24. [Test]
  25. public void CreateBindingElements ()
  26. {
  27. WebHttpBinding b = new WebHttpBinding ();
  28. BindingElementCollection bc = b.CreateBindingElements ();
  29. Assert.AreEqual (2, bc.Count, "#1");
  30. Assert.AreEqual (typeof (WebMessageEncodingBindingElement), bc [0].GetType (), "#2");
  31. Assert.AreEqual (typeof (HttpTransportBindingElement), bc [1].GetType (), "#3");
  32. }
  33. }
  34. }