@@ -20,13 +20,14 @@ namespace Microsoft.ComponentDetection.Detectors.Tests
20
20
public class Spdx22ComponentDetectorTests
21
21
{
22
22
private DetectorTestUtility < Spdx22ComponentDetector > detectorTestUtility ;
23
+ private string tempPath = Path . GetTempPath ( ) ;
23
24
24
25
[ TestInitialize ]
25
26
public void TestInitialize ( )
26
27
{
27
28
var componentRecorder = new ComponentRecorder ( enableManualTrackingOfExplicitReferences : false ) ;
28
29
detectorTestUtility = DetectorTestUtilityCreator . Create < Spdx22ComponentDetector > ( )
29
- . WithScanRequest ( new ScanRequest ( new DirectoryInfo ( Path . GetTempPath ( ) ) , null , null , new Dictionary < string , string > ( ) , null , componentRecorder ) ) ;
30
+ . WithScanRequest ( new ScanRequest ( new DirectoryInfo ( tempPath ) , null , null , new Dictionary < string , string > ( ) , null , componentRecorder ) ) ;
30
31
}
31
32
32
33
[ TestMethod ]
@@ -96,8 +97,9 @@ public async Task TestSbomDetector_SimpleSbom()
96
97
]
97
98
}" ;
98
99
100
+ var spdxFileName = "manifest.spdx.json" ;
99
101
var ( scanResult , componentRecorder ) = await detectorTestUtility
100
- . WithFile ( "manifest.spdx.json" , spdxFile )
102
+ . WithFile ( spdxFileName , spdxFile )
101
103
. ExecuteDetector ( ) ;
102
104
103
105
Assert . AreEqual ( ProcessingResultCode . Success , scanResult . ResultCode ) ;
@@ -122,6 +124,7 @@ public async Task TestSbomDetector_SimpleSbom()
122
124
Assert . AreEqual ( sbomComponent . DocumentNamespace , new Uri ( "https://sbom.microsoft/Test/1.0.0/61de1a5-57cc-4732-9af5-edb321b4a7ee" ) ) ;
123
125
Assert . AreEqual ( sbomComponent . SpdxVersion , "SPDX-2.2" ) ;
124
126
Assert . AreEqual ( sbomComponent . Checksum , checksum ) ;
127
+ Assert . AreEqual ( sbomComponent . Path , Path . Combine ( tempPath , spdxFileName ) ) ;
125
128
}
126
129
127
130
[ TestMethod ]
0 commit comments