9eb4671e13a783a970f9b8851827eba68ed92daa
[mono.git] / mcs / class / System.ServiceModel / Test / FeatureBased / Features.Serialization / OperationContractTester.cs
1 using System;\r
2 using System.Collections.Generic;\r
3 using System.Text;\r
4 using Proxy.MonoTests.Features.Client;\r
5 using NUnit.Framework;\r
6 using System.ServiceModel;\r
7 using MonoTests.Features.Contracts;\r
8 using System.Threading;\r
9 \r
10 namespace MonoTests.Features.Serialization\r
11 {\r
12         [TestFixture]\r
13         public class OperationContractTest : TestFixtureBase<OperationContractClient, OperationContractServer, MonoTests.Features.Contracts.IOperationContract>\r
14         {\r
15                 [Test]\r
16                 [Category("NotWorking")]\r
17                 public void TestName () {\r
18                         Assert.AreEqual(Client.OrigMethod(),2,"Calling OrigMethod should actually call RenamedMethod");\r
19                         Assert.AreEqual(Client.RenamedMethod(),1,"Calling RenamedMethod should actually call OrigMethod");\r
20                 }\r
21 \r
22                 [Test]\r
23                 [Category("NotWorking")]\r
24                 public void TestOneWay () {\r
25                         int sleepTime = 1 * 1000, failTime = 500; // Good times for inproc, no debugging.\r
26                         if (!Configuration.IsLocal) {\r
27                                 sleepTime = 5 * 1000;\r
28                                 failTime = 2 * 1000;\r
29                         }\r
30                         DateTime start = DateTime.Now;\r
31                         Client.Sleep (sleepTime);\r
32                         DateTime end = DateTime.Now;\r
33                         TimeSpan diff = end.Subtract (start);\r
34                         TimeSpan max = TimeSpan.FromMilliseconds(failTime);\r
35                         Assert.IsTrue (diff < max, "Sleep({0} milisec) must end in less than {1} seconds",sleepTime,failTime);\r
36                         if (sleepTime > (int) diff.TotalMilliseconds)\r
37                                 Thread.Sleep (sleepTime - (int)diff.TotalMilliseconds); // wait for server thread to release itself\r
38                 }\r
39 \r
40                 [Test]\r
41                 [Category ("NotWorking")]\r
42                 public void TestWsdl () {\r
43                         CheckWsdlImpl ();\r
44                 }\r
45         }\r
46 }