@@ -22,18 +22,13 @@ public class BaselinePackageValidatorTests
22
22
[ Fact ]
23
23
public void TfmDroppedInLatestVersion ( )
24
24
{
25
- string [ ] previousFilePaths = new [ ]
26
- {
27
- @"ref/netcoreapp3.1/TestPackage.dll" ,
28
- @"ref/netstandard2.0/TestPackage.dll"
29
- } ;
30
- Package baselinePackage = new ( string . Empty , "TestPackage" , "1.0.0" , previousFilePaths , null ) ;
31
-
32
- string [ ] currentFilePaths = new [ ]
33
- {
34
- @"ref/netcoreapp3.1/TestPackage.dll"
35
- } ;
36
- Package package = new ( string . Empty , "TestPackage" , "2.0.0" , currentFilePaths , null ) ;
25
+ Package baselinePackage = new ( string . Empty , "TestPackage" , "1.0.0" ,
26
+ [
27
+ @"lib/netcoreapp3.1/TestPackage.dll" ,
28
+ @"lib/netstandard2.0/TestPackage.dll"
29
+ ] ) ;
30
+ Package package = new ( string . Empty , "TestPackage" , "2.0.0" , [ @"lib/netcoreapp3.1/TestPackage.dll" ] ) ;
31
+
37
32
( SuppressibleTestLog log , BaselinePackageValidator validator ) = CreateLoggerAndValidator ( ) ;
38
33
39
34
validator . Validate ( new PackageValidatorOption ( package ,
@@ -44,5 +39,26 @@ public void TfmDroppedInLatestVersion()
44
39
Assert . NotEmpty ( log . errors ) ;
45
40
Assert . Contains ( DiagnosticIds . TargetFrameworkDropped + " " + string . Format ( Resources . MissingTargetFramework , ".NETStandard,Version=v2.0" ) , log . errors ) ;
46
41
}
42
+
43
+ [ Fact ]
44
+ public void BaselineFrameworksExcluded ( )
45
+ {
46
+ Package baselinePackage = new ( string . Empty , "TestPackage" , "1.0.0" ,
47
+ [
48
+ @"lib/netcoreapp3.1/TestPackage.dll" ,
49
+ @"lib/netstandard2.0/TestPackage.dll"
50
+ ] ) ;
51
+ Package package = new ( string . Empty , "TestPackage" , "2.0.0" , [ @"lib/netstandard2.0/TestPackage.dll" ] ) ;
52
+
53
+ ( SuppressibleTestLog log , BaselinePackageValidator validator ) = CreateLoggerAndValidator ( ) ;
54
+
55
+ validator . Validate ( new PackageValidatorOption ( package ,
56
+ enableStrictMode : false ,
57
+ enqueueApiCompatWorkItems : false ,
58
+ baselinePackage : baselinePackage ,
59
+ baselinePackageFrameworksToIgnore : [ "netcoreapp3.1" ] ) ) ;
60
+
61
+ Assert . Empty ( log . errors ) ;
62
+ }
47
63
}
48
64
}
0 commit comments