@@ -13,7 +13,8 @@ public enum TestLanguage
1313 CSharp ,
1414 Java ,
1515 TypeScript ,
16- PHP
16+ PHP ,
17+ ObjC
1718 }
1819
1920 public static class MultipleNamespacesTestRunner
@@ -26,7 +27,7 @@ public static class MultipleNamespacesTestRunner
2627 private const string MetadataMultipleNamespacesFile = "MetadataMultipleNamespaces.xml" ;
2728
2829 // contains microsoft.graph and microsoft.graph.callRecords
29- // TypeScript and PHP rely on the assumption that all namespaces will be a subnamespace to microsoft.graph
30+ // TypeScript, ObjC and PHP rely on the assumption that all namespaces will be a subnamespace to microsoft.graph
3031 // and generation process creates a single file with nested namespaces
3132 private const string MetadataWithSubNamespacesFile = "MetadataWithSubNamespaces.xml" ;
3233
@@ -44,6 +45,8 @@ string getMetadataFile(TestLanguage testLanguage)
4445 return MetadataWithSubNamespacesFile ;
4546 case TestLanguage . PHP :
4647 return MetadataWithSubNamespacesFile ;
48+ case TestLanguage . ObjC :
49+ return MetadataWithSubNamespacesFile ;
4750 default :
4851 throw new ArgumentException ( "unexpected test language" , nameof ( testLanguage ) ) ;
4952 }
@@ -136,26 +139,32 @@ private static void CompareFiles(StringBuilder testOutputBuilder, string expecte
136139 /// <returns></returns>
137140 private static IEnumerable < ( string , string ) > GetFilePaths ( TestLanguage language , string dataDirectory , string testDataDirectoryName , string outputDirectoryName )
138141 {
139- string extension = string . Empty ;
142+ HashSet < string > extensions = new HashSet < string > ( ) ;
140143 switch ( language )
141144 {
142145 case TestLanguage . CSharp :
143- extension = "* .cs";
146+ extensions . Add ( " .cs") ;
144147 break ;
145148 case TestLanguage . Java :
146- extension = "* .java";
149+ extensions . Add ( " .java") ;
147150 break ;
148151 case TestLanguage . TypeScript :
149- extension = "* .ts";
152+ extensions . Add ( " .ts") ;
150153 break ;
151154 case TestLanguage . PHP :
152- extension = "*.php" ;
155+ extensions . Add ( ".php" ) ;
156+ break ;
157+ case TestLanguage . ObjC :
158+ extensions . Add ( ".m" ) ;
159+ extensions . Add ( ".h" ) ;
153160 break ;
154161 default :
155162 throw new ArgumentException ( "unexpected test language" , nameof ( language ) ) ;
156163 }
157164
158- return from file in new DirectoryInfo ( dataDirectory ) . GetFiles ( extension , SearchOption . AllDirectories )
165+ return from file in new DirectoryInfo ( dataDirectory )
166+ . EnumerateFiles ( "*" , SearchOption . AllDirectories )
167+ . Where ( f => extensions . Contains ( f . Extension ) )
159168 let actualOutputFilePath = file . FullName . Replace ( testDataDirectoryName , outputDirectoryName )
160169 let expectedFilePath = file . FullName
161170 select ( expectedFilePath , actualOutputFilePath ) ;
0 commit comments