File tree Expand file tree Collapse file tree
PSql.Deploy.Tests/Internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,16 +26,28 @@ public void Load_Empty()
2626 [ Test ]
2727 public void LoadUnmanagedDll_Found ( )
2828 {
29- PrivateAssemblyLoadContext
30- . Instance
31- . SimulateLoadUnmanagedDll ( "Microsoft.Data.SqlClient.SNI" )
32- . ShouldNotBe ( IntPtr . Zero ) ;
29+ if ( OperatingSystem . IsWindows ( ) )
30+ {
31+ PrivateAssemblyLoadContext
32+ . Instance
33+ . SimulateLoadUnmanagedDll ( "Microsoft.Data.SqlClient.SNI" )
34+ . ShouldNotBe ( IntPtr . Zero ) ;
3335
34- // Exercise caching
35- PrivateAssemblyLoadContext
36- . Instance
37- . SimulateLoadUnmanagedDll ( "Microsoft.Data.SqlClient.SNI" )
38- . ShouldNotBe ( IntPtr . Zero ) ;
36+ // Exercise caching
37+ PrivateAssemblyLoadContext
38+ . Instance
39+ . SimulateLoadUnmanagedDll ( "Microsoft.Data.SqlClient.SNI" )
40+ . ShouldNotBe ( IntPtr . Zero ) ;
41+ }
42+ else
43+ {
44+ Should . Throw < BadImageFormatException > ( ( ) =>
45+ {
46+ PrivateAssemblyLoadContext
47+ . Instance
48+ . SimulateLoadUnmanagedDll ( "Microsoft.Data.SqlClient.SNI" ) ;
49+ } ) ;
50+ }
3951 }
4052
4153 [ Test ]
You can’t perform that action at this time.
0 commit comments