@@ -24,16 +24,30 @@ public void InitResources()
2424            RubberduckUI . Culture  =  Thread . CurrentThread . CurrentUICulture ; 
2525        } 
2626
27+         private  static List < Type >  GetAllBaseTypes ( Type  type ) 
28+         { 
29+             var  baseTypes  =  new  List < Type > ( ) ; 
30+ 
31+             var  baseType  =  type . BaseType ; 
32+             while  ( baseType  !=  null ) 
33+             { 
34+                 baseTypes . Add ( baseType ) ; 
35+                 baseType  =  baseType . BaseType ; 
36+             } 
37+ 
38+             return  baseTypes ; 
39+         } 
40+ 
2741        [ TestMethod ] 
2842        [ TestCategory ( "Inspections" ) ] 
2943        public  void  InspectionNameStringsExist ( ) 
3044        { 
3145            var  inspections  =  typeof ( InspectionBase ) . Assembly . GetTypes ( ) 
32-                           . Where ( type =>  type . BaseType   ==   typeof ( InspectionBase )  &&  ! type . IsAbstract ) 
33-                           . Where ( i =>  string . IsNullOrEmpty ( InspectionsUI . ResourceManager . GetString ( i . Name  +  "Name" ) ) ) 
46+                           . Where ( type =>  GetAllBaseTypes ( type ) . Contains ( typeof ( InspectionBase ) )  &&  ! type . IsAbstract ) 
47+                           . Where ( i =>  string . IsNullOrWhiteSpace ( InspectionsUI . ResourceManager . GetString ( i . Name  +  "Name" ) ) ) 
3448                          . Select ( i =>  i . Name ) 
3549                          . ToList ( ) ; 
36-              
50+ 
3751            Assert . IsFalse ( inspections . Any ( ) ,  string . Join ( Environment . NewLine ,  inspections ) ) ; 
3852        } 
3953
@@ -42,7 +56,7 @@ public void InspectionNameStringsExist()
4256        public  void  InspectionMetaStringsExist ( ) 
4357        { 
4458            var  inspections  =  typeof ( InspectionBase ) . Assembly . GetTypes ( ) 
45-                           . Where ( type =>  type . BaseType   ==   typeof ( InspectionBase )  &&  ! type . IsAbstract ) 
59+                           . Where ( type =>  GetAllBaseTypes ( type ) . Contains ( typeof ( InspectionBase ) )  &&  ! type . IsAbstract ) 
4660                          . Where ( i =>  string . IsNullOrEmpty ( InspectionsUI . ResourceManager . GetString ( i . Name  +  "Meta" ) ) ) 
4761                          . Select ( i =>  i . Name ) 
4862                          . ToList ( ) ; 
@@ -67,7 +81,7 @@ public void InspectionResultFormatStringsExist()
6781            } ; 
6882
6983            var  inspections  =  typeof ( InspectionBase ) . Assembly . GetTypes ( ) 
70-                           . Where ( type =>  type . BaseType   ==   typeof ( InspectionBase )  &&  ! type . IsAbstract ) 
84+                           . Where ( type =>  GetAllBaseTypes ( type ) . Contains ( typeof ( InspectionBase ) )  &&  ! type . IsAbstract ) 
7185                          . Where ( i =>  ! inspectionsWithSharedResultFormat . Contains ( i . Name )  && 
7286                                      string . IsNullOrEmpty ( InspectionsUI . ResourceManager . GetString ( i . Name  +  "ResultFormat" ) ) ) 
7387                          . Select ( i =>  i . Name ) 
@@ -81,7 +95,7 @@ public void InspectionResultFormatStringsExist()
8195        public  void  InspectionNameStrings_AreNotFormatted ( ) 
8296        { 
8397            var  inspections  =  typeof ( InspectionBase ) . Assembly . GetTypes ( ) 
84-                           . Where ( type =>  type . BaseType   ==   typeof ( InspectionBase ) ) 
98+                           . Where ( type =>  GetAllBaseTypes ( type ) . Contains ( typeof ( InspectionBase ) ) ) 
8599                          . Where ( i => 
86100                          { 
87101                              var  value  =  InspectionsUI . ResourceManager . GetString ( i . Name  +  "Name" ) ; 
0 commit comments