[corlib] Avoid unnecessary ephemeron array resizes
[mono.git] / mcs / class / System.Web.Services / Test / System.Web.Services.Protocols / LogicalMethodInfoTest.cs
1 //
2 // LogicalMethodInfoTest.cs
3 //
4 // Author:
5 //      Atsushi Enomoto  <atsushi@ximian.com>
6 //
7 // Copyright (C) 2007 Novell, Inc.
8 //
9 #if !MOBILE
10 using NUnit.Framework;
11
12 using System;
13 using System.Globalization;
14 using System.IO;
15 using System.Reflection;
16 using System.Web.Services;
17 using System.Web.Services.Configuration;
18 using System.Web.Services.Description;
19 using System.Web.Services.Protocols;
20 using System.Xml.Schema;
21 using System.Xml.Serialization;
22
23 namespace MonoTests.System.Web.Services.Protocol
24 {
25         [TestFixture]
26         public class LogicalMethodInfoTest
27         {
28                 [Test]
29                 public void BeginEndMethodInfo ()
30                 {
31                         LogicalMethodInfo [] ll = LogicalMethodInfo.Create (
32                         new MethodInfo [] {
33                         typeof (FooService).GetMethod ("BeginEcho"),
34                         typeof (FooService).GetMethod ("EndEcho")});
35                         Assert.AreEqual (1, ll.Length, "#1");
36                         LogicalMethodInfo l = ll [0];
37                         Assert.IsNull (l.MethodInfo, "#2");
38                         Assert.IsNotNull (l.BeginMethodInfo, "#3");
39                         Assert.IsNotNull (l.EndMethodInfo, "#4");
40                 }
41
42                 class FooService : WebService
43                 {
44                         public string Echo (string arg)
45                         {
46                                 return arg;
47                         }
48
49                         public IAsyncResult BeginEcho (string arg, AsyncCallback cb, object state)
50                         {
51                                 return null;
52                         }
53
54                         public string EndEcho (IAsyncResult result)
55                         {
56                                 return null;
57                         }
58                 }
59         }
60 }
61 #endif