SignatureHelperTest.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. //
  2. // SignatureHelperTest.cs
  3. //
  4. // Author: Atsushi Enomoto <[email protected]>
  5. //
  6. // Copyright (C) 2007 Novell, Inc.
  7. //
  8. using System;
  9. using System.Reflection;
  10. using System.Reflection.Emit;
  11. using NUnit.Framework;
  12. namespace MonoTests.System.Reflection.Emit
  13. {
  14. [TestFixture]
  15. public class SignatureHelperTest
  16. {
  17. [Test]
  18. public void GetFieldSigHelperNullModule ()
  19. {
  20. SignatureHelper.GetFieldSigHelper (null);
  21. }
  22. [Test]
  23. public void GetLocalVarSigHelperNullModule ()
  24. {
  25. SignatureHelper.GetLocalVarSigHelper (null);
  26. }
  27. [Test]
  28. public void GetMethodSigHelperNullModule ()
  29. {
  30. SignatureHelper.GetMethodSigHelper (null, CallingConventions.Standard, typeof (int));
  31. }
  32. [Test]
  33. [ExpectedException (typeof (ArgumentException))]
  34. public void GetFieldSigHelperNormalModule ()
  35. {
  36. SignatureHelper.GetFieldSigHelper (typeof (int).Module);
  37. }
  38. [Test]
  39. [ExpectedException (typeof (ArgumentException))]
  40. public void GetLocalVarSigHelperNormalModule ()
  41. {
  42. SignatureHelper.GetLocalVarSigHelper (typeof (int).Module);
  43. }
  44. [Test]
  45. [ExpectedException (typeof (ArgumentException))]
  46. public void GetMethodSigHelperNormalModule ()
  47. {
  48. SignatureHelper.GetMethodSigHelper (typeof (int).Module, CallingConventions.Standard, typeof (int));
  49. }
  50. }
  51. }