AssemblyTest.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // System.Reflection.Assembly Test Cases
  3. //
  4. // Authors:
  5. // Gonzalo Paniagua Javier ([email protected])
  6. // Philippe Lavoie ([email protected])
  7. //
  8. // (c) 2003 Ximian, Inc. (http://www.ximian.com)
  9. //
  10. using NUnit.Framework;
  11. using System;
  12. using System.Reflection;
  13. namespace MonoTests.System.Reflection
  14. {
  15. [TestFixture]
  16. public class AssemblyTest : Assertion
  17. {
  18. [Test]
  19. public void CreateInstance()
  20. {
  21. Type type = typeof (AssemblyTest);
  22. Object obj = type.Assembly.CreateInstance ("MonoTests.System.Reflection.AssemblyTest");
  23. AssertNotNull ("#01", obj);
  24. AssertEquals ("#02", GetType(), obj.GetType());
  25. }
  26. [Test]
  27. public void CreateInvalidInstance()
  28. {
  29. Type type = typeof (AssemblyTest);
  30. Object obj = type.Assembly.CreateInstance("NunitTests.ThisTypeDoesNotExist");
  31. AssertNull ("#03", obj);
  32. }
  33. }
  34. }