@@ -34,7 +34,7 @@ public AppDomain CreateDomain(TestPackage package)
34
34
AppDomainSetup setup = CreateAppDomainSetup ( package ) ;
35
35
36
36
string hashCode = string . Empty ;
37
- if ( package . Name != null )
37
+ if ( package . Name is not null )
38
38
{
39
39
hashCode = package . Name . GetHashCode ( ) . ToString ( "x" ) + "-" ;
40
40
}
@@ -80,7 +80,7 @@ private AppDomainSetup CreateAppDomainSetup(TestPackage package)
80
80
// .NET versions greater than v4.0 report as v4.0, so look at
81
81
// the TargetFrameworkAttribute on the assembly if it exists
82
82
// If property is null, .NET 4.5+ is not installed, so there is no need
83
- if ( TargetFrameworkNameProperty != null )
83
+ if ( TargetFrameworkNameProperty is not null )
84
84
{
85
85
var frameworkName = package . GetSetting ( EnginePackageSettings . ImageTargetFrameworkName , string . Empty ) ;
86
86
if ( frameworkName != string . Empty )
@@ -133,7 +133,7 @@ public void Unload()
133
133
throw new NUnitEngineUnloadException ( msg ) ;
134
134
}
135
135
136
- if ( _unloadException != null )
136
+ if ( _unloadException is not null )
137
137
throw new NUnitEngineUnloadException ( "Exception encountered unloading application domain" , _unloadException ) ;
138
138
}
139
139
@@ -231,7 +231,7 @@ private static bool IsExecutable(string? fileName)
231
231
var assemblies = new List < string > ( ) ;
232
232
233
233
// All subpackages have full names, but this is a public method in a public class so we have no control.
234
- foreach ( var package in packages . Where ( p => p . FullName != null ) )
234
+ foreach ( var package in packages . Where ( p => p . FullName is not null ) )
235
235
assemblies . Add ( package . FullName ! ) ;
236
236
237
237
return GetCommonAppBase ( assemblies ) ;
@@ -244,10 +244,10 @@ private static bool IsExecutable(string? fileName)
244
244
foreach ( string assembly in assemblies )
245
245
{
246
246
string ? dir = Path . GetDirectoryName ( Path . GetFullPath ( assembly ) ) ! ;
247
- if ( commonBase == null )
247
+ if ( commonBase is null )
248
248
commonBase = dir ;
249
249
else
250
- while ( commonBase != null && ! PathUtils . SamePathOrUnder ( commonBase , dir ) )
250
+ while ( commonBase is not null && ! PathUtils . SamePathOrUnder ( commonBase , dir ) )
251
251
commonBase = Path . GetDirectoryName ( commonBase ) ! ;
252
252
}
253
253
@@ -266,7 +266,7 @@ private static bool IsExecutable(string? fileName)
266
266
if ( package . GetSetting ( EnginePackageSettings . AutoBinPath , binPath == string . Empty ) )
267
267
binPath = package . SubPackages . Count > 0
268
268
? GetPrivateBinPath ( appBase , package . SubPackages )
269
- : package . FullName != null
269
+ : package . FullName is not null
270
270
? GetPrivateBinPath ( appBase , package . FullName )
271
271
: null ;
272
272
@@ -276,7 +276,7 @@ private static bool IsExecutable(string? fileName)
276
276
public static string ? GetPrivateBinPath ( string basePath , IList < TestPackage > packages )
277
277
{
278
278
var assemblies = new List < string > ( ) ;
279
- foreach ( var package in packages . Where ( p => p . FullName != null ) )
279
+ foreach ( var package in packages . Where ( p => p . FullName is not null ) )
280
280
assemblies . Add ( package . FullName ! ) ;
281
281
282
282
return GetPrivateBinPath ( basePath , assemblies ) ;
@@ -292,7 +292,7 @@ private static bool IsExecutable(string? fileName)
292
292
string ? dir = PathUtils . RelativePath (
293
293
Path . GetFullPath ( basePath ) ,
294
294
Path . GetDirectoryName ( Path . GetFullPath ( assembly ) ) ! ) ;
295
- if ( dir != null && dir != string . Empty && dir != "." && ! dirList . Contains ( dir ) )
295
+ if ( dir is not null && dir != string . Empty && dir != "." && ! dirList . Contains ( dir ) )
296
296
{
297
297
dirList . Add ( dir ) ;
298
298
if ( sb . Length > 0 )
0 commit comments