WebHttpBindingTest.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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. Assert.AreEqual (0x80000, b.MaxBufferPoolSize, "#4");
  19. Assert.AreEqual (0x10000, b.MaxReceivedMessageSize, "#5");
  20. Assert.IsFalse (((IBindingRuntimePreferences) b).ReceiveSynchronously, "#6");
  21. }
  22. [Test]
  23. public void CreateBindingElements ()
  24. {
  25. WebHttpBinding b = new WebHttpBinding ();
  26. BindingElementCollection bc = b.CreateBindingElements ();
  27. Assert.AreEqual (2, bc.Count, "#1");
  28. Assert.AreEqual (typeof (WebMessageEncodingBindingElement), bc [0].GetType (), "#2");
  29. Assert.AreEqual (typeof (HttpTransportBindingElement), bc [1].GetType (), "#3");
  30. }
  31. }
  32. }