Author: spouliot
Date: 2007-11-21 15:44:53 -0500 (Wed, 21 Nov 2007)
New Revision: 90109

Modified:
   
trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/AvoidUninstantiatedInternalClassesTest.cs
   trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/ChangeLog
Log:
2007-11-21  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * AvoidUninstantiatedInternalClassesTest.cs: Moved class outside
        the fixture (because it made them all nested). Removed test for 
        InternalsVisibleToAttribute. This must be done from another assembly 
        (or it will mess every results in this one).



Modified: 
trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/AvoidUninstantiatedInternalClassesTest.cs
===================================================================
--- 
trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/AvoidUninstantiatedInternalClassesTest.cs
        2007-11-21 19:53:26 UTC (rev 90108)
+++ 
trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/AvoidUninstantiatedInternalClassesTest.cs
        2007-11-21 20:44:53 UTC (rev 90109)
@@ -33,91 +33,74 @@
 using Mono.Cecil;
 using NUnit.Framework;
 
-namespace Test.Rules.Performance
-{
-       [TestFixture]
-       public class AvoidUninstantiatedInternalClassesTest {
-               
-               internal class UninstantiatedInternalClass
+namespace Test.Rules.Performance {
+
+       internal class UninstantiatedInternalClass {
+
+               public void display ()
                {
-                       public void display ()
-                       {
-                       }
-                       
-                       public static void Main (string [] args)
-                       {
-                       }
                }
-               
-               internal class InstantiatedInternalClass
+
+               public static void Main (string [] args)
                {
-                       public void display ()
-                       {
-                       }
-                       public static void Main (string [] args)
-                       {
-                               InstantiatedInternalClass i = new 
InstantiatedInternalClass ();
-                               i.display ();
-                       }
                }
-               
-               internal class NestedInternalUninstantiatedClass
+       }
+
+       internal class InstantiatedInternalClass {
+
+               public void display ()
                {
-                       public class NestedClass
-                       {
-                               public void display ()
-                               {
-                               }
-                       }
                }
-               
-               internal class NestedInternalInstantiatedClass
+
+               public static void Main (string [] args)
                {
-                       public class NestedClass
-                       {
-                               public static void Main (string [] args)
-                               {
-                                       NestedInternalInstantiatedClass n = new 
NestedInternalInstantiatedClass ();
-                               }
-                       }
+                       InstantiatedInternalClass i = new 
InstantiatedInternalClass ();
+                       i.display ();
                }
-               
-               public class NonInternalClassNotInstantiated
-               {
+       }
+
+       internal class NestedInternalUninstantiatedClass {
+               public class NestedClass {
                        public void display ()
                        {
                        }
                }
-               
-               public static class StaticClass
-               {
-                       public static void display ()
+       }
+
+       internal class NestedInternalInstantiatedClass {
+               public class NestedClass {
+                       public static void Main (string [] args)
                        {
+                               NestedInternalInstantiatedClass n = new 
NestedInternalInstantiatedClass ();
                        }
                }
-               
-               internal class MethodContainingObjectCallIsNotCalled
+       }
+
+       public class NonInternalClassNotInstantiated {
+               public void display ()
                {
-                       public void display ()
-                       {
-                               MethodContainingObjectCallIsNotCalled n = new 
MethodContainingObjectCallIsNotCalled ();
-                       }
                }
-               
-               internal interface IFace
+       }
+
+       public static class StaticClass {
+               public static void display ()
                {
-                       void display ();
                }
-               
-#if net_2_0
-               [assembly:InternalsVisibleToAttribute ("BadPractice")]
-               internal class ImplementingInternalsVisibleToAttribute
-               { 
-                       public static void Main (string [] args)
-                       {
-                       }
+       }
+
+       internal class MethodContainingObjectCallIsNotCalled {
+               public void display ()
+               {
+                       MethodContainingObjectCallIsNotCalled n = new 
MethodContainingObjectCallIsNotCalled ();
                }
-#endif
+       }
+
+       internal interface IFace {
+               void display ();
+       }
+
+       [TestFixture]
+       public class AvoidUninstantiatedInternalClassesTest {
                
                private ITypeRule typeRule;
                private AssemblyDefinition assembly;
@@ -135,7 +118,7 @@
                
                private TypeDefinition GetTest (string name)
                {
-                       string fullname = 
"Test.Rules.Performance.AvoidUninstantiatedInternalClassesTest/" + name;
+                       string fullname = "Test.Rules.Performance." + name;
                        return assembly.MainModule.Types[fullname];
                }
                
@@ -205,15 +188,5 @@
                        messageCollection = typeRule.CheckType (type, new 
MinimalRunner ());
                        Assert.IsNull (messageCollection);
                }
-               
-#if net_2_0
-               [Test]
-               public void implementingInternalsVisibleToAttributeTest ()
-               {
-                       type = GetTest 
("ImplementingInternalsVisibleToAttribute");
-                       messageCollection = typeRule.CheckType (type, new 
MinimalRunner ());
-                       Assert.IsNull (messageCollection);
-               }
-#endif
        }
-}
\ No newline at end of file
+}

Modified: trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/ChangeLog
===================================================================
--- trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/ChangeLog        
2007-11-21 19:53:26 UTC (rev 90108)
+++ trunk/cecil/gendarme/rules/Gendarme.Rules.Performance/Test/ChangeLog        
2007-11-21 20:44:53 UTC (rev 90109)
@@ -1,3 +1,10 @@
+2007-11-21  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * AvoidUninstantiatedInternalClassesTest.cs: Moved class outside
+       the fixture (because it made them all nested). Removed test for 
+       InternalsVisibleToAttribute. This must be done from another assembly 
+       (or it will mess every results in this one).
+
 2007-11-21  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * AvoidUncalledPrivateCodeTest.cs: Word around bug #343465 so test

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

Reply via email to