LogicalMethodInfoTest.cs 1.3 KB

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