Skip to content

Commit 2b94be0

Browse files
MalcolmnixonMalcolm Nixon
andauthored
Add multitarget support for DotNet 8, 9, and 10 (#62)
Update dependencies. Co-authored-by: Malcolm Nixon <Malcolm.Nixon@hiarc.inc>
1 parent 08b2697 commit 2b94be0

32 files changed

+120
-117
lines changed

.config/dotnet-tools.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
"isRoot": true,
44
"tools": {
55
"dotnet-sonarscanner": {
6-
"version": "10.2.0",
6+
"version": "11.0.0",
77
"commands": [
88
"dotnet-sonarscanner"
99
]
1010
},
1111
"microsoft.sbom.dotnettool": {
12-
"version": "4.0.3",
12+
"version": "4.1.4",
1313
"commands": [
1414
"sbom-tool"
1515
]
1616
},
1717
"demaconsulting.spdxtool": {
18-
"version": "2.3.0",
18+
"version": "2.4.0",
1919
"commands": [
2020
"spdx-tool"
2121
]

.github/workflows/build.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,17 @@ jobs:
2424
steps:
2525

2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v6
2828
with:
2929
fetch-depth: 0
3030

31-
- name: Setup dotnet 6/8
32-
uses: actions/setup-dotnet@v4
31+
- name: Setup dotnet
32+
uses: actions/setup-dotnet@v5
3333
with:
3434
dotnet-version: |
35-
6.x
3635
8.x
36+
9.x
37+
10.x
3738
3839
- name: Restore Tools
3940
run: >
@@ -117,7 +118,7 @@ jobs:
117118
--property:PackageVersion=${{ inputs.version }}
118119
119120
- name: Upload Artifacts
120-
uses: actions/upload-artifact@v4
121+
uses: actions/upload-artifact@v5
121122
with:
122123
name: artifacts-${{ inputs.os }}
123124
path: |

.github/workflows/release.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ jobs:
4040
needs: build
4141

4242
steps:
43-
- uses: actions/checkout@v4
43+
- uses: actions/checkout@v6
4444

45-
- name: Setup dotnet 8
45+
- name: Setup dotnet
4646
uses: actions/setup-dotnet@v4
4747
with:
4848
dotnet-version: |
49-
8.x
49+
10.x
5050
5151
- name: Download Artifacts
52-
uses: actions/download-artifact@v4
52+
uses: actions/download-artifact@v6
5353
with:
5454
name: artifacts-ubuntu-latest
5555
path: artifacts

src/DemaConsulting.SpdxModel/DemaConsulting.SpdxModel.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
5+
<LangVersion>12</LangVersion>
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>enable</Nullable>
78
<GenerateDocumentationFile>True</GenerateDocumentationFile>
@@ -48,7 +49,7 @@
4849
</ItemGroup>
4950

5051
<ItemGroup>
51-
<PackageReference Include="System.Text.Json" Version="9.0.6" />
52+
<PackageReference Include="System.Text.Json" Version="10.0.0" />
5253
</ItemGroup>
5354

5455
</Project>

test/DemaConsulting.SpdxModel.Tests/DemaConsulting.SpdxModel.Tests.csproj

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<TargetFrameworks>net8.0</TargetFrameworks>
4+
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
5+
<LangVersion>12</LangVersion>
56
<ImplicitUsings>enable</ImplicitUsings>
67
<Nullable>enable</Nullable>
78

@@ -26,9 +27,9 @@
2627
<PrivateAssets>all</PrivateAssets>
2728
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
2829
</PackageReference>
29-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.14.1" />
30-
<PackageReference Include="MSTest.TestAdapter" Version="3.9.3" />
31-
<PackageReference Include="MSTest.TestFramework" Version="3.9.3" />
30+
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />
31+
<PackageReference Include="MSTest.TestAdapter" Version="4.0.2" />
32+
<PackageReference Include="MSTest.TestFramework" Version="4.0.2" />
3233
</ItemGroup>
3334

3435
<ItemGroup>

test/DemaConsulting.SpdxModel.Tests/IO/Spdx2JsonDeserialize22.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
4545
doc.Validate(issues);
4646

4747
// Assert: Verify that there are no validation issues
48-
Assert.AreEqual(0, issues.Count);
48+
Assert.IsEmpty(issues);
4949

5050
// Assert: Verify the document properties
5151
Assert.AreEqual("SPDX-Tools-v2.0", doc.Name);
5252
Assert.AreEqual("SPDX-2.2", doc.Version);
5353
Assert.AreEqual("http://spdx.org/spdxdocs/spdx-example-json-2.2-444504E0-4F89-41D3-9A0C-0305E82C3301",
5454
doc.DocumentNamespace);
5555
Assert.AreEqual("This document was created using SPDX 2.0 using licenses from the web site.", doc.Comment);
56-
Assert.AreEqual(3, doc.CreationInformation.Creators.Length);
56+
Assert.HasCount(3, doc.CreationInformation.Creators);
5757
Assert.AreEqual("Tool: LicenseFind-1.0", doc.CreationInformation.Creators[0]);
5858
Assert.AreEqual("Organization: ExampleCodeInspect ()", doc.CreationInformation.Creators[1]);
5959
Assert.AreEqual("Person: Jane Doe ()", doc.CreationInformation.Creators[2]);
@@ -62,15 +62,15 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
6262
Assert.AreEqual("3.9", doc.CreationInformation.LicenseListVersion);
6363

6464
// Assert: Verify external document references
65-
Assert.AreEqual(1, doc.ExternalDocumentReferences.Length);
65+
Assert.HasCount(1, doc.ExternalDocumentReferences);
6666
Assert.AreEqual("DocumentRef-spdx-tool-1.2", doc.ExternalDocumentReferences[0].ExternalDocumentId);
6767
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.ExternalDocumentReferences[0].Checksum.Algorithm);
6868
Assert.AreEqual("d6a770ba38583ed4bb4525bd96e50461655d2759", doc.ExternalDocumentReferences[0].Checksum.Value);
6969
Assert.AreEqual("http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
7070
doc.ExternalDocumentReferences[0].Document);
7171

7272
// Assert: Verify extracted licensing info
73-
Assert.AreEqual(5, doc.ExtractedLicensingInfo.Length);
73+
Assert.HasCount(5, doc.ExtractedLicensingInfo);
7474
Assert.AreEqual("LicenseRef-Beerware-4.2", doc.ExtractedLicensingInfo[0].LicenseId);
7575
StringAssert.StartsWith(doc.ExtractedLicensingInfo[0].ExtractedText, "\"THE BEER-WARE LICENSE\"");
7676
Assert.AreEqual("LicenseRef-4", doc.ExtractedLicensingInfo[1].LicenseId);
@@ -79,7 +79,7 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
7979
Assert.AreEqual("LicenseRef-3", doc.ExtractedLicensingInfo[2].LicenseId);
8080
StringAssert.StartsWith(doc.ExtractedLicensingInfo[2].ExtractedText, "The CyberNeko Software License");
8181
Assert.AreEqual("CyberNeko License", doc.ExtractedLicensingInfo[2].Name);
82-
Assert.AreEqual(2, doc.ExtractedLicensingInfo[2].CrossReferences.Length);
82+
Assert.HasCount(2, doc.ExtractedLicensingInfo[2].CrossReferences);
8383
Assert.AreEqual("http://people.apache.org/~andyc/neko/LICENSE",
8484
doc.ExtractedLicensingInfo[2].CrossReferences[0]);
8585
Assert.AreEqual("http://justasample.url.com", doc.ExtractedLicensingInfo[2].CrossReferences[1]);
@@ -90,7 +90,7 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
9090
StringAssert.StartsWith(doc.ExtractedLicensingInfo[4].ExtractedText, "/*\n * (c) Copyright 2000, 2001, 2002");
9191

9292
// Assert: Verify annotations
93-
Assert.AreEqual(3, doc.Annotations.Length);
93+
Assert.HasCount(3, doc.Annotations);
9494
Assert.AreEqual("Person: Jane Doe ()", doc.Annotations[0].Annotator);
9595
Assert.AreEqual("2010-01-29T18:30:22Z", doc.Annotations[0].Date);
9696
Assert.AreEqual(SpdxAnnotationType.Other, doc.Annotations[0].Type);
@@ -105,19 +105,19 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
105105
StringAssert.StartsWith(doc.Annotations[2].Comment, "This is just an example");
106106

107107
// Assert: Verify files
108-
Assert.AreEqual(4, doc.Files.Length);
108+
Assert.HasCount(4, doc.Files);
109109
Assert.AreEqual("SPDXRef-DoapSource", doc.Files[0].Id);
110110
Assert.AreEqual("./src/org/spdx/parser/DOAPProject.java", doc.Files[0].FileName);
111-
Assert.AreEqual(1, doc.Files[0].FileTypes.Length);
111+
Assert.HasCount(1, doc.Files[0].FileTypes);
112112
Assert.IsTrue(doc.Files[0].FileTypes.Contains(SpdxFileType.Source));
113-
Assert.AreEqual(1, doc.Files[0].Checksums.Length);
113+
Assert.HasCount(1, doc.Files[0].Checksums);
114114
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.Files[0].Checksums[0].Algorithm);
115115
Assert.AreEqual("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12", doc.Files[0].Checksums[0].Value);
116116
Assert.AreEqual("Apache-2.0", doc.Files[0].ConcludedLicense);
117-
Assert.AreEqual(1, doc.Files[0].LicenseInfoInFiles.Length);
117+
Assert.HasCount(1, doc.Files[0].LicenseInfoInFiles);
118118
Assert.AreEqual("Apache-2.0", doc.Files[0].LicenseInfoInFiles[0]);
119119
Assert.AreEqual("Copyright 2010, 2011 Source Auditor Inc.", doc.Files[0].CopyrightText);
120-
Assert.AreEqual(5, doc.Files[0].Contributors.Length);
120+
Assert.HasCount(5, doc.Files[0].Contributors);
121121
Assert.AreEqual("Protecode Inc.", doc.Files[0].Contributors[0]);
122122
Assert.AreEqual("SPDX Technical Team Members", doc.Files[0].Contributors[1]);
123123
Assert.AreEqual("Open Logic Inc.", doc.Files[0].Contributors[2]);
@@ -126,35 +126,35 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx22JsonReturnsExpectedDocu
126126
Assert.AreEqual("This file is used by Jena", doc.Files[1].Comment);
127127
StringAssert.StartsWith(doc.Files[1].Notice, "Apache Commons Lang\nCopyright 2001-2011");
128128
Assert.AreEqual("This license is used by Jena", doc.Files[2].LicenseComments);
129-
Assert.AreEqual(1, doc.Files[3].Annotations.Length);
129+
Assert.HasCount(1, doc.Files[3].Annotations);
130130
Assert.AreEqual("Person: File Commenter", doc.Files[3].Annotations[0].Annotator);
131131
Assert.AreEqual("2011-01-29T18:30:22Z", doc.Files[3].Annotations[0].Date);
132132
Assert.AreEqual(SpdxAnnotationType.Other, doc.Files[3].Annotations[0].Type);
133133
Assert.AreEqual("File level annotation", doc.Files[3].Annotations[0].Comment);
134-
Assert.AreEqual(2, doc.Files[3].Checksums.Length);
134+
Assert.HasCount(2, doc.Files[3].Checksums);
135135
Assert.AreEqual(SpdxChecksumAlgorithm.Md5, doc.Files[3].Checksums[0].Algorithm);
136136
Assert.AreEqual("624c1abb3664f4b35547e7c73864ad24", doc.Files[3].Checksums[0].Value);
137137
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.Files[3].Checksums[1].Algorithm);
138138
Assert.AreEqual("d6a770ba38583ed4bb4525bd96e50461655d2758", doc.Files[3].Checksums[1].Value);
139139

140140
// Assert: Verify snippets
141-
Assert.AreEqual(1, doc.Snippets.Length);
141+
Assert.HasCount(1, doc.Snippets);
142142
Assert.AreEqual("SPDXRef-Snippet", doc.Snippets[0].Id);
143143
Assert.AreEqual("SPDXRef-DoapSource", doc.Snippets[0].SnippetFromFile);
144144
Assert.AreEqual(310, doc.Snippets[0].SnippetByteStart);
145145
Assert.AreEqual(420, doc.Snippets[0].SnippetByteEnd);
146146
Assert.AreEqual(5, doc.Snippets[0].SnippetLineStart);
147147
Assert.AreEqual(23, doc.Snippets[0].SnippetLineEnd);
148148
Assert.AreEqual("GPL-2.0-only", doc.Snippets[0].ConcludedLicense);
149-
Assert.AreEqual(1, doc.Snippets[0].LicenseInfoInSnippet.Length);
149+
Assert.HasCount(1, doc.Snippets[0].LicenseInfoInSnippet);
150150
Assert.AreEqual("GPL-2.0-only", doc.Snippets[0].LicenseInfoInSnippet[0]);
151151
StringAssert.StartsWith(doc.Snippets[0].LicenseComments, "The concluded license was taken");
152152
Assert.AreEqual("Copyright 2008-2010 John Smith", doc.Snippets[0].CopyrightText);
153153
StringAssert.StartsWith(doc.Snippets[0].Comment, "This snippet was identified as significant");
154154
Assert.AreEqual("from linux kernel", doc.Snippets[0].Name);
155155

156156
// Assert: Verify relationships
157-
Assert.AreEqual(9, doc.Relationships.Length);
157+
Assert.HasCount(9, doc.Relationships);
158158
Assert.AreEqual("SPDXRef-DOCUMENT", doc.Relationships[0].Id);
159159
Assert.AreEqual("SPDXRef-Package", doc.Relationships[0].RelatedSpdxElement);
160160
Assert.AreEqual(SpdxRelationshipType.Contains, doc.Relationships[0].RelationshipType);

test/DemaConsulting.SpdxModel.Tests/IO/Spdx2JsonDeserialize23.cs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx23JsonReturnsExpectedDocu
4545
doc.Validate(issues);
4646

4747
// Assert: Verify that there are no validation issues
48-
Assert.AreEqual(0, issues.Count);
48+
Assert.IsEmpty(issues);
4949

5050
// Assert: Verify document
5151
Assert.AreEqual("SPDX-Tools-v2.0", doc.Name);
5252
Assert.AreEqual("SPDX-2.3", doc.Version);
5353
Assert.AreEqual("http://spdx.org/spdxdocs/spdx-example-json-2.3-444504E0-4F89-41D3-9A0C-0305E82C3301",
5454
doc.DocumentNamespace);
5555
Assert.AreEqual("This document was created using SPDX 2.0 using licenses from the web site.", doc.Comment);
56-
Assert.AreEqual(3, doc.CreationInformation.Creators.Length);
56+
Assert.HasCount(3, doc.CreationInformation.Creators);
5757
Assert.AreEqual("Tool: LicenseFind-1.0", doc.CreationInformation.Creators[0]);
5858
Assert.AreEqual("Organization: ExampleCodeInspect ()", doc.CreationInformation.Creators[1]);
5959
Assert.AreEqual("Person: Jane Doe ()", doc.CreationInformation.Creators[2]);
@@ -62,15 +62,15 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx23JsonReturnsExpectedDocu
6262
Assert.AreEqual("3.17", doc.CreationInformation.LicenseListVersion);
6363

6464
// Assert: Verify external document references
65-
Assert.AreEqual(1, doc.ExternalDocumentReferences.Length);
65+
Assert.HasCount(1, doc.ExternalDocumentReferences);
6666
Assert.AreEqual("DocumentRef-spdx-tool-1.2", doc.ExternalDocumentReferences[0].ExternalDocumentId);
6767
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.ExternalDocumentReferences[0].Checksum.Algorithm);
6868
Assert.AreEqual("d6a770ba38583ed4bb4525bd96e50461655d2759", doc.ExternalDocumentReferences[0].Checksum.Value);
6969
Assert.AreEqual("http://spdx.org/spdxdocs/spdx-tools-v1.2-3F2504E0-4F89-41D3-9A0C-0305E82C3301",
7070
doc.ExternalDocumentReferences[0].Document);
7171

7272
// Assert: Verify extracted licensing info
73-
Assert.AreEqual(5, doc.ExtractedLicensingInfo.Length);
73+
Assert.HasCount(5, doc.ExtractedLicensingInfo);
7474
Assert.AreEqual("LicenseRef-1", doc.ExtractedLicensingInfo[0].LicenseId);
7575
StringAssert.StartsWith(doc.ExtractedLicensingInfo[0].ExtractedText,
7676
"/*\n * (c) Copyright 2000, 2001, 2002, 2003");
@@ -83,20 +83,20 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx23JsonReturnsExpectedDocu
8383
StringAssert.StartsWith(
8484
doc.ExtractedLicensingInfo[3].ExtractedText, "\"THE BEER-WARE LICENSE\" (Revision 42)");
8585
Assert.AreEqual("Beer-Ware License (Version 42)", doc.ExtractedLicensingInfo[3].Name);
86-
Assert.AreEqual(1, doc.ExtractedLicensingInfo[3].CrossReferences.Length);
86+
Assert.HasCount(1, doc.ExtractedLicensingInfo[3].CrossReferences);
8787
Assert.AreEqual("http://people.freebsd.org/~phk/", doc.ExtractedLicensingInfo[3].CrossReferences[0]);
8888
StringAssert.StartsWith(doc.ExtractedLicensingInfo[3].Comment, "The beerware license has");
8989
Assert.AreEqual("LicenseRef-3", doc.ExtractedLicensingInfo[4].LicenseId);
9090
StringAssert.StartsWith(doc.ExtractedLicensingInfo[4].ExtractedText, "The CyberNeko Software License");
9191
Assert.AreEqual("CyberNeko License", doc.ExtractedLicensingInfo[4].Name);
92-
Assert.AreEqual(2, doc.ExtractedLicensingInfo[4].CrossReferences.Length);
92+
Assert.HasCount(2, doc.ExtractedLicensingInfo[4].CrossReferences);
9393
Assert.AreEqual("http://people.apache.org/~andyc/neko/LICENSE",
9494
doc.ExtractedLicensingInfo[4].CrossReferences[0]);
9595
Assert.AreEqual("http://justasample.url.com", doc.ExtractedLicensingInfo[4].CrossReferences[1]);
9696
StringAssert.StartsWith(doc.ExtractedLicensingInfo[4].Comment, "This is the CyperNeko License");
9797

9898
// Assert: Verify annotations
99-
Assert.AreEqual(3, doc.Annotations.Length);
99+
Assert.HasCount(3, doc.Annotations);
100100
Assert.AreEqual("Person: Jane Doe ()", doc.Annotations[0].Annotator);
101101
Assert.AreEqual("2010-01-29T18:30:22Z", doc.Annotations[0].Date);
102102
Assert.AreEqual(SpdxAnnotationType.Other, doc.Annotations[0].Type);
@@ -111,19 +111,19 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx23JsonReturnsExpectedDocu
111111
StringAssert.StartsWith(doc.Annotations[2].Comment, "Another example reviewer.");
112112

113113
// Assert: Verify files
114-
Assert.AreEqual(5, doc.Files.Length);
114+
Assert.HasCount(5, doc.Files);
115115
Assert.AreEqual("SPDXRef-DoapSource", doc.Files[0].Id);
116116
Assert.AreEqual("./src/org/spdx/parser/DOAPProject.java", doc.Files[0].FileName);
117-
Assert.AreEqual(1, doc.Files[0].FileTypes.Length);
117+
Assert.HasCount(1, doc.Files[0].FileTypes);
118118
Assert.IsTrue(doc.Files[0].FileTypes.Contains(SpdxFileType.Source));
119-
Assert.AreEqual(1, doc.Files[0].Checksums.Length);
119+
Assert.HasCount(1, doc.Files[0].Checksums);
120120
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.Files[0].Checksums[0].Algorithm);
121121
Assert.AreEqual("2fd4e1c67a2d28fced849ee1bb76e7391b93eb12", doc.Files[0].Checksums[0].Value);
122122
Assert.AreEqual("Apache-2.0", doc.Files[0].ConcludedLicense);
123-
Assert.AreEqual(1, doc.Files[0].LicenseInfoInFiles.Length);
123+
Assert.HasCount(1, doc.Files[0].LicenseInfoInFiles);
124124
Assert.AreEqual("Apache-2.0", doc.Files[0].LicenseInfoInFiles[0]);
125125
Assert.AreEqual("Copyright 2010, 2011 Source Auditor Inc.", doc.Files[0].CopyrightText);
126-
Assert.AreEqual(5, doc.Files[0].Contributors.Length);
126+
Assert.HasCount(5, doc.Files[0].Contributors);
127127
Assert.AreEqual("Protecode Inc.", doc.Files[0].Contributors[0]);
128128
Assert.AreEqual("SPDX Technical Team Members", doc.Files[0].Contributors[1]);
129129
Assert.AreEqual("Open Logic Inc.", doc.Files[0].Contributors[2]);
@@ -132,30 +132,30 @@ public void Spdx2JsonDeserializer_Deserialize_ValidSpdx23JsonReturnsExpectedDocu
132132
Assert.AreEqual("This file is used by Jena", doc.Files[1].Comment);
133133
StringAssert.StartsWith(doc.Files[1].Notice, "Apache Commons Lang\nCopyright 2001-2011");
134134
Assert.AreEqual("This license is used by Jena", doc.Files[2].LicenseComments);
135-
Assert.AreEqual(2, doc.Files[4].Checksums.Length);
135+
Assert.HasCount(2, doc.Files[4].Checksums);
136136
Assert.AreEqual(SpdxChecksumAlgorithm.Sha1, doc.Files[4].Checksums[0].Algorithm);
137137
Assert.AreEqual("d6a770ba38583ed4bb4525bd96e50461655d2758", doc.Files[4].Checksums[0].Value);
138138
Assert.AreEqual(SpdxChecksumAlgorithm.Md5, doc.Files[4].Checksums[1].Algorithm);
139139
Assert.AreEqual("624c1abb3664f4b35547e7c73864ad24", doc.Files[4].Checksums[1].Value);
140140

141141
// Assert: Verify snippets
142-
Assert.AreEqual(1, doc.Snippets.Length);
142+
Assert.HasCount(1, doc.Snippets);
143143
Assert.AreEqual("SPDXRef-Snippet", doc.Snippets[0].Id);
144144
Assert.AreEqual("SPDXRef-DoapSource", doc.Snippets[0].SnippetFromFile);
145145
Assert.AreEqual(310, doc.Snippets[0].SnippetByteStart);
146146
Assert.AreEqual(420, doc.Snippets[0].SnippetByteEnd);
147147
Assert.AreEqual(5, doc.Snippets[0].SnippetLineStart);
148148
Assert.AreEqual(23, doc.Snippets[0].SnippetLineEnd);
149149
Assert.AreEqual("GPL-2.0-only", doc.Snippets[0].ConcludedLicense);
150-
Assert.AreEqual(1, doc.Snippets[0].LicenseInfoInSnippet.Length);
150+
Assert.HasCount(1, doc.Snippets[0].LicenseInfoInSnippet);
151151
Assert.AreEqual("GPL-2.0-only", doc.Snippets[0].LicenseInfoInSnippet[0]);
152152
StringAssert.StartsWith(doc.Snippets[0].LicenseComments, "The concluded license was taken");
153153
Assert.AreEqual("Copyright 2008-2010 John Smith", doc.Snippets[0].CopyrightText);
154154
StringAssert.StartsWith(doc.Snippets[0].Comment, "This snippet was identified as significant");
155155
Assert.AreEqual("from linux kernel", doc.Snippets[0].Name);
156156

157157
// Assert: Verify relationships
158-
Assert.AreEqual(7, doc.Relationships.Length);
158+
Assert.HasCount(7, doc.Relationships);
159159
Assert.AreEqual("SPDXRef-DOCUMENT", doc.Relationships[0].Id);
160160
Assert.AreEqual("SPDXRef-Package", doc.Relationships[0].RelatedSpdxElement);
161161
Assert.AreEqual(SpdxRelationshipType.Contains, doc.Relationships[0].RelationshipType);

0 commit comments

Comments
 (0)