@@ -27,18 +27,19 @@ public class NuGetAuditTests : SharedVisualStudioHostTestClass
2727 [ Timeout ( DefaultTimeout ) ]
2828 public async Task PackagesConfig_SuppressAdvisory ( )
2929 {
30- // 1. Create Directory.Build.props with suppression for package.A cve1
31- // 2. Create mock server with package.A with cve1 and cve2
30+ // 1. Create Directory.Build.props with suppression for package.A cve1 and cve2
31+ // 2. Create mock server with package.A with cve1, cve2, and cve3
3232 // 3. Add mock server to nuget.config
3333 // 3. Create packages.config project
3434 // 4. Install package.A
35- // 5. check error list to see if only cve2 is listed
35+ // 5. check error list to see if only cve3 is listed
3636
3737 // Arrange
3838 SimpleTestPathContext testPathContext = new ( ) ;
3939 var dbpContents = @"<Project>
4040 <ItemGroup>
4141 <NuGetAuditSuppress Include=""https://cve.test/1"" />
42+ <NuGetAuditSuppress Include=""https://cve.test/2"" />
4243 </ItemGroup>
4344</Project>" ;
4445 File . WriteAllText ( Path . Combine ( testPathContext . SolutionRoot , "Directory.Build.props" ) , dbpContents ) ;
@@ -48,6 +49,7 @@ public async Task PackagesConfig_SuppressAdvisory()
4849 {
4950 ( new Uri ( "https://cve.test/1" ) , PackageVulnerabilitySeverity . High , VersionRange . Parse ( "(, 2.0.0)" ) ) ,
5051 ( new Uri ( "https://cve.test/2" ) , PackageVulnerabilitySeverity . High , VersionRange . Parse ( "(, 2.0.0)" ) ) ,
52+ ( new Uri ( "https://cve.test/3" ) , PackageVulnerabilitySeverity . High , VersionRange . Parse ( "(, 2.0.0)" ) ) ,
5153 } ) ;
5254
5355 await CommonUtility . CreatePackageInSourceAsync ( testPathContext . PackageSource , TestPackageName , TestPackageVersionV1 ) ;
@@ -71,7 +73,7 @@ public async Task PackagesConfig_SuppressAdvisory()
7173
7274 var errors = VisualStudio . ObjectModel . Shell . ToolWindows . ErrorList . AllItems . Select ( i => i . Description ) . ToList ( ) ;
7375 errors . Where ( msg => msg . Contains ( TestPackageName ) ) . Should ( ) . ContainSingle ( ) ;
74- errors . Single ( msg => msg . Contains ( TestPackageName ) ) . Should ( ) . Contain ( "https://cve.test/2 " ) ;
76+ errors . Single ( msg => msg . Contains ( TestPackageName ) ) . Should ( ) . Contain ( "https://cve.test/3 " ) ;
7577 }
7678 }
7779}
0 commit comments