Author: spouliot
Date: 2005-04-14 09:28:29 -0400 (Thu, 14 Apr 2005)
New Revision: 43002

Modified:
   trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
   trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
Log:
2005-04-14  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * AssemblyTest.cs: Added tests for GetObjectData (null) and 
        GetReferencedAssemblies (no codebase returned) methods.



Modified: trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs       
2005-04-14 13:27:10 UTC (rev 43001)
+++ trunk/mcs/class/corlib/Test/System.Reflection/AssemblyTest.cs       
2005-04-14 13:28:29 UTC (rev 43002)
@@ -7,7 +7,7 @@
 //     Sebastien Pouliot ([EMAIL PROTECTED])
 //
 // (c) 2003 Ximian, Inc. (http://www.ximian.com)
-// Copyright (C) 2004 Novell, Inc (http://www.novell.com)
+// Copyright (C) 2004-2005 Novell, Inc (http://www.novell.com)
 //
 // Permission is hereby granted, free of charge, to any person obtaining
 // a copy of this software and associated documentation files (the
@@ -31,9 +31,11 @@
 
 using NUnit.Framework;
 using System;
+using System.Configuration.Assemblies;
 using System.Globalization;
 using System.IO;
 using System.Reflection;
+using System.Runtime.Serialization;
 using System.Security;
 
 namespace MonoTests.System.Reflection
@@ -189,6 +191,33 @@
                        Assert.IsTrue (corlib != null || corlib2 != null);
                }
 
+               [Test]
+               [ExpectedException (typeof (ArgumentNullException))]
+               public void GetObjectData_Null ()
+               {
+                       Assembly corlib = typeof (int).Assembly;
+                       corlib.GetObjectData (null, new StreamingContext 
(StreamingContextStates.All));
+               }
+
+               [Test]
+               public void GetReferencedAssemblies ()
+               {
+                       Assembly corlib_test = Assembly.GetExecutingAssembly ();
+                       AssemblyName[] names = 
corlib_test.GetReferencedAssemblies ();
+                       foreach (AssemblyName an in names) {
+                               Assert.IsNull (an.CodeBase, "CodeBase");
+                               Assert.IsNotNull (an.CultureInfo, 
"CultureInfo");
+                               Assert.IsNull (an.EscapedCodeBase, 
"EscapedCodeBase");
+                               Assert.AreEqual (AssemblyNameFlags.None, 
an.Flags, "Flags");
+                               Assert.IsNotNull (an.FullName, "FullName");
+                               Assert.AreEqual (AssemblyHashAlgorithm.SHA1, 
an.HashAlgorithm, "HashAlgorithm");
+                               Assert.IsNull (an.KeyPair, "KeyPair");
+                               Assert.IsNotNull (an.Name, "Name");
+                               Assert.IsNotNull (an.Version, "Version");
+                               Assert.AreEqual 
(AssemblyVersionCompatibility.SameMachine, 
+                                       an.VersionCompatibility, 
"VersionCompatibility");
+                       }
+               }
 #if NET_2_0
                [Test]
                public void ReflectionOnlyLoad ()

Modified: trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog
===================================================================
--- trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog     2005-04-14 
13:27:10 UTC (rev 43001)
+++ trunk/mcs/class/corlib/Test/System.Reflection/ChangeLog     2005-04-14 
13:28:29 UTC (rev 43002)
@@ -1,3 +1,8 @@
+2005-04-14  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * AssemblyTest.cs: Added tests for GetObjectData (null) and 
+       GetReferencedAssemblies (no codebase returned) methods.
+
 2005-04-08  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * FieldInfoTest.cs (RefOnlyFieldClass): Rename from RefOnlyClass.

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to