2009-06-09 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Tue, 9 Jun 2009 07:50:32 +0000 (07:50 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Tue, 9 Jun 2009 07:50:32 +0000 (07:50 -0000)
* ChannelDispatcherTest.cs : add ServiceThrottle test, and comments.

svn path=/trunk/mcs/; revision=135729

mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/ChangeLog
mcs/class/System.ServiceModel/Test/System.ServiceModel.Dispatcher/ChannelDispatcherTest.cs

index a7b66d8e43617f17b2bab1738af47b8f572e27a2..4774de9409343c3f1c154022d2320d19738c9c4b 100644 (file)
@@ -1,3 +1,7 @@
+2009-06-09  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * ChannelDispatcherTest.cs : add ServiceThrottle test, and comments.
+
 2009-05-13  Atsushi Enomoto  <atsushi@ximian.com>
 
        * ChannelDispatcherTest.cs : make sure ctor args are nullable.
index f7b7c9f8dbd55e5f364238bda44b8aeecb689b1f..d925ee8d63daa06f797fe1f7331c95c4985ec24d 100644 (file)
@@ -21,6 +21,35 @@ namespace MonoTests.System.ServiceModel.Dispatcher
                        new ChannelDispatcher (new MyChannelListener (new Uri ("urn:foo")), null, null);
                }
 
+               [Test]
+               public void ServiceThrottle ()
+               {
+                       var cd = new ChannelDispatcher (new MyChannelListener<IReplyChannel> (new Uri ("urn:foo")));
+                       var st = cd.ServiceThrottle;
+                       Assert.IsNull (st, "#0");
+
+                       var uri = new Uri ("http://localhost:37564");
+                       ServiceHost h = new ServiceHost (typeof (TestContract), uri);
+                       h.AddServiceEndpoint (typeof (TestContract).FullName, new BasicHttpBinding (), "address");
+                       h.ChannelDispatchers.Add (cd);
+                       Assert.IsNull (st, "#1");
+                       var ed = new EndpointDispatcher (new EndpointAddress (uri), "", "");
+                       ed.DispatchRuntime.Type = typeof (TestContract);
+                       cd.Endpoints.Add (ed);
+                       cd.MessageVersion = MessageVersion.Default;
+
+                       {
+                               cd.Open ();
+                               try {
+                                       Assert.IsNull (st, "#2");
+                                       // so, can't really test actual slot values as it is null.
+                               } finally {
+                                       cd.Close ();
+                               }
+                               return;
+                       }
+               }
+
                [Test]                  
                public void Collection_Add_Remove () {
                        Console.WriteLine ("STart test Collection_Add_Remove");