1313
1414public class AssemblyInfoTest : IClassFixture < MSBuildFixture > // The MSBuildFixture throws PlatformNotSupportedException when run on mono.
1515{
16- [ Theory ]
16+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
1717 [ InlineData ( false ) ]
1818 [ InlineData ( true ) ]
1919 [ InlineData ( null ) ]
@@ -49,15 +49,7 @@ public void FSharpGenerator(bool? thisAssemblyClass)
4949 info . EmitThisAssemblyClass = thisAssemblyClass . GetValueOrDefault ( ) ;
5050 }
5151
52- string built ;
53- try
54- {
55- built = info . BuildCode ( ) ;
56- }
57- catch ( PlatformNotSupportedException ex )
58- {
59- throw SkipException . ForSkip ( ex . Message ) ;
60- }
52+ string built = info . BuildCode ( ) ;
6153
6254 string expected = $@ "//------------------------------------------------------------------------------
6355// <auto-generated>
@@ -99,7 +91,7 @@ type internal ThisAssembly() =
9991 Assert . Equal ( expected , built ) ;
10092 }
10193
102- [ Theory ]
94+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
10395 [ InlineData ( null , "MyRootNamespace" ) ]
10496 [ InlineData ( "" , "MyRootNamespace" ) ]
10597 [ InlineData ( "MyCustomNamespace" , null ) ]
@@ -117,15 +109,7 @@ public void FSharpGeneratorWithNamespace(string thisAssemblyNamespace, string ro
117109 ThisAssemblyNamespace = thisAssemblyNamespace ,
118110 } ;
119111
120- string built ;
121- try
122- {
123- built = info . BuildCode ( ) ;
124- }
125- catch ( PlatformNotSupportedException ex )
126- {
127- throw SkipException . ForSkip ( ex . Message ) ;
128- }
112+ string built = info . BuildCode ( ) ;
129113
130114 string expected = $@ "//------------------------------------------------------------------------------
131115// <auto-generated>
@@ -168,7 +152,7 @@ type internal ThisAssembly() =
168152 Assert . Equal ( expected , built ) ;
169153 }
170154
171- [ Theory ]
155+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
172156 [ InlineData ( false ) ]
173157 [ InlineData ( true ) ]
174158 [ InlineData ( null ) ]
@@ -204,15 +188,7 @@ public void CSharpGenerator(bool? thisAssemblyClass)
204188 info . EmitThisAssemblyClass = thisAssemblyClass . GetValueOrDefault ( ) ;
205189 }
206190
207- string built ;
208- try
209- {
210- built = info . BuildCode ( ) ;
211- }
212- catch ( PlatformNotSupportedException ex )
213- {
214- throw SkipException . ForSkip ( ex . Message ) ;
215- }
191+ string built = info . BuildCode ( ) ;
216192
217193 string expected = $@ "//------------------------------------------------------------------------------
218194// <auto-generated>
@@ -252,7 +228,7 @@ internal static partial class ThisAssembly {{
252228 Assert . Equal ( expected , built ) ;
253229 }
254230
255- [ Theory ]
231+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
256232 [ InlineData ( null , "MyRootNamespace" ) ]
257233 [ InlineData ( "" , "MyRootNamespace" ) ]
258234 [ InlineData ( "MyCustomNamespace" , null ) ]
@@ -270,15 +246,7 @@ public void CSharpGeneratorWithNamespace(string thisAssemblyNamespace, string ro
270246 ThisAssemblyNamespace = thisAssemblyNamespace ,
271247 } ;
272248
273- string built ;
274- try
275- {
276- built = info . BuildCode ( ) ;
277- }
278- catch ( PlatformNotSupportedException ex )
279- {
280- throw SkipException . ForSkip ( ex . Message ) ;
281- }
249+ string built = info . BuildCode ( ) ;
282250
283251 ( string nsStart , string nsEnd ) = ! string . IsNullOrWhiteSpace ( thisAssemblyNamespace )
284252 ? ( $ "{ Environment . NewLine } namespace { thisAssemblyNamespace } {{", $ "{ Environment . NewLine } }}")
@@ -318,7 +286,7 @@ internal static partial class ThisAssembly {{
318286 Assert . Equal ( expected , built ) ;
319287 }
320288
321- [ Theory ]
289+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
322290 [ InlineData ( false ) ]
323291 [ InlineData ( true ) ]
324292 [ InlineData ( null ) ]
@@ -335,15 +303,7 @@ public void VisualBasicGenerator(bool? thisAssemblyClass)
335303 info . EmitThisAssemblyClass = thisAssemblyClass . GetValueOrDefault ( ) ;
336304 }
337305
338- string built ;
339- try
340- {
341- built = info . BuildCode ( ) ;
342- }
343- catch ( PlatformNotSupportedException ex )
344- {
345- throw SkipException . ForSkip ( ex . Message ) ;
346- }
306+ string built = info . BuildCode ( ) ;
347307
348308 string expected = $@ "'------------------------------------------------------------------------------
349309' <auto-generated>
@@ -382,7 +342,7 @@ End Class
382342 Assert . Equal ( expected , built ) ;
383343 }
384344
385- [ Theory ]
345+ [ SkippableTheory ( typeof ( PlatformNotSupportedException ) ) ]
386346 [ InlineData ( null , "MyRootNamespace" ) ]
387347 [ InlineData ( "" , "MyRootNamespace" ) ]
388348 [ InlineData ( "MyCustomNamespace" , null ) ]
@@ -400,15 +360,7 @@ public void VisualBasicGeneratorWithNamespace(string thisAssemblyNamespace, stri
400360 ThisAssemblyNamespace = thisAssemblyNamespace ,
401361 } ;
402362
403- string built ;
404- try
405- {
406- built = info . BuildCode ( ) ;
407- }
408- catch ( PlatformNotSupportedException ex )
409- {
410- throw SkipException . ForSkip ( ex . Message ) ;
411- }
363+ string built = info . BuildCode ( ) ;
412364
413365 ( string nsStart , string nsEnd ) = ! string . IsNullOrWhiteSpace ( thisAssemblyNamespace )
414366 ? ( $ "{ Environment . NewLine } Namespace { thisAssemblyNamespace } ", $ "{ Environment . NewLine } End Namespace")
0 commit comments