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