Skip to content

Commit a0fc9f8

Browse files
committed
update to dotnet 10
1 parent f481ebe commit a0fc9f8

File tree

10 files changed

+37
-36
lines changed

10 files changed

+37
-36
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,13 @@ Server start:
121121

122122
# ChangeLog
123123

124-
<details open="open"><summary>v0.3.1</summary>
124+
<details open="open"><summary>v0.3.2</summary>
125+
126+
>- Update to dotnet 10
127+
128+
</details>
129+
130+
<details><summary>v0.3.1</summary>
125131

126132
>- **Breaking Changes**
127133
>- Code Lists fix to receive meta information

src/pax.XRechnung.NET.tests/AnnotationDtoTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public void FromXml_MapsCorrectlyToDto()
8686
Assert.AreEqual(xml.Id.Content, dto.Id);
8787
Assert.AreEqual(xml.DocumentCurrencyCode, dto.DocumentCurrencyCode);
8888
Assert.AreEqual(xml.SellerParty.Party.PartyName.Name, dto.SellerParty.Name);
89-
Assert.AreEqual(xml.InvoiceLines.Count, dto.InvoiceLines.Count);
89+
Assert.HasCount(xml.InvoiceLines.Count, dto.InvoiceLines);
9090
}
9191

9292
[TestMethod]
@@ -99,7 +99,7 @@ public void Roundtrip_ProducesEquivalentXml()
9999
var roundtripXml = mapper.ToXml(dto);
100100

101101
Assert.AreEqual(original.Id.Content, roundtripXml.Id.Content);
102-
Assert.AreEqual(original.InvoiceLines.Count, roundtripXml.InvoiceLines.Count);
102+
Assert.HasCount(original.InvoiceLines.Count, roundtripXml.InvoiceLines);
103103
Assert.AreEqual(original.SellerParty.Party.PartyName.Name, roundtripXml.SellerParty.Party.PartyName.Name);
104104
}
105105

src/pax.XRechnung.NET.tests/BaseDtoTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public void FromXml_MapsCorrectlyToDto()
8484
Assert.AreEqual(xml.Id.Content, dto.Id);
8585
Assert.AreEqual(xml.DocumentCurrencyCode, dto.DocumentCurrencyCode);
8686
Assert.AreEqual(xml.SellerParty.Party.PartyName.Name, dto.SellerParty.Name);
87-
Assert.AreEqual(xml.InvoiceLines.Count, dto.InvoiceLines.Count);
87+
Assert.HasCount(xml.InvoiceLines.Count, dto.InvoiceLines);
8888
}
8989

9090
[TestMethod]
@@ -97,7 +97,7 @@ public void Roundtrip_ProducesEquivalentXml()
9797
var roundtripXml = mapper.ToXml(dto);
9898

9999
Assert.AreEqual(original.Id.Content, roundtripXml.Id.Content);
100-
Assert.AreEqual(original.InvoiceLines.Count, roundtripXml.InvoiceLines.Count);
100+
Assert.HasCount(original.InvoiceLines.Count, roundtripXml.InvoiceLines);
101101
Assert.AreEqual(original.SellerParty.Party.PartyName.Name, roundtripXml.SellerParty.Party.PartyName.Name);
102102
}
103103
}

src/pax.XRechnung.NET.tests/CustomDtoTests.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public void FromXml_MapsCorrectlyToDto()
8585
Assert.AreEqual(xml.Id.Content, dto.Id);
8686
Assert.AreEqual(xml.DocumentCurrencyCode, dto.DocumentCurrencyCode);
8787
Assert.AreEqual(xml.SellerParty.Party.PartyName.Name, dto.SellerParty.Name);
88-
Assert.AreEqual(xml.InvoiceLines.Count, dto.InvoiceLines.Count);
88+
Assert.HasCount(xml.InvoiceLines.Count, dto.InvoiceLines);
8989
}
9090

9191
[TestMethod]
@@ -98,7 +98,7 @@ public void Roundtrip_ProducesEquivalentXml()
9898
var roundtripXml = mapper.ToXml(dto);
9999

100100
Assert.AreEqual(original.Id.Content, roundtripXml.Id.Content);
101-
Assert.AreEqual(original.InvoiceLines.Count, roundtripXml.InvoiceLines.Count);
101+
Assert.HasCount(original.InvoiceLines.Count, roundtripXml.InvoiceLines);
102102
Assert.AreEqual(original.SellerParty.Party.PartyName.Name, roundtripXml.SellerParty.Party.PartyName.Name);
103103
}
104104

@@ -117,7 +117,7 @@ public void CanAddLine()
117117
var mapper = new MyCustomInvoiceMapper();
118118
var xmlInvoice = mapper.ToXml(invoiceAnnDto);
119119

120-
Assert.AreEqual(2, xmlInvoice.InvoiceLines.Count);
120+
Assert.HasCount(2, xmlInvoice.InvoiceLines);
121121

122122
var result = XmlInvoiceValidator.Validate(xmlInvoice);
123123
Assert.IsTrue(result.IsValid);

src/pax.XRechnung.NET.tests/DeSerializationTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace pax.XRechnung.NET.tests;
1111
[TestClass]
1212
public sealed class DeSerializationTests
1313
{
14-
[DataTestMethod]
14+
[TestMethod]
1515
[DataRow("02.01a-INVOICE_ubl.xml")]
1616
[DataRow("02.02a-INVOICE_ubl.xml")]
1717
[DataRow("02.03a-INVOICE_ubl.xml")]

src/pax.XRechnung.NET.tests/SchematronValidationTests.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ public async Task CanProduceValidXmlInvoice()
200200

201201
var result = await XmlInvoiceValidator.ValidateSchematron(xmlInvoice);
202202
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
203-
Assert.IsTrue(result.Validations.Count == 0, resultText);
203+
Assert.IsEmpty(result.Validations, resultText);
204204
Assert.IsTrue(result.IsValid, resultText);
205205
}
206206

@@ -233,7 +233,7 @@ public async Task CanValidateBaseDtoSchematronTest()
233233
XmlInvoice xmlInvoice = invoiceMapper.ToXml(invoiceBaseDto);
234234
var result = await XmlInvoiceValidator.ValidateSchematron(xmlInvoice);
235235
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
236-
Assert.IsTrue(result.Validations.Count == 0, resultText);
236+
Assert.IsEmpty(result.Validations, resultText);
237237
Assert.IsTrue(result.IsValid, resultText);
238238
}
239239

@@ -256,7 +256,7 @@ public async Task CanValidateBaseDtoSchematronWithRoundingTest()
256256
XmlInvoice xmlInvoice = invoiceMapper.ToXml(invoiceBaseDto);
257257
var result = await XmlInvoiceValidator.ValidateSchematron(xmlInvoice);
258258
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
259-
Assert.IsTrue(result.Validations.Count == 0, resultText);
259+
Assert.IsEmpty(result.Validations, resultText);
260260
Assert.IsTrue(result.IsValid, resultText);
261261
}
262262

@@ -277,7 +277,7 @@ public async Task CanProduceValidInvoiceDto()
277277

278278
var result = await XmlInvoiceValidator.ValidateSchematron(mappedXmlInvoice);
279279
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
280-
Assert.IsTrue(result.Validations.Count == 0, resultText);
280+
Assert.IsEmpty(result.Validations, resultText);
281281
Assert.IsTrue(result.IsValid, resultText);
282282
}
283283

@@ -294,7 +294,7 @@ public async Task CanValidateExtendedDto()
294294
var xmlInvoice = mapper.ToXml(invoiceExtendedDto);
295295
var result = await XmlInvoiceValidator.ValidateSchematron(xmlInvoice);
296296
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
297-
Assert.IsTrue(result.Validations.Count == 0, resultText);
297+
Assert.IsEmpty(result.Validations, resultText);
298298
Assert.IsTrue(result.IsValid, resultText);
299299
}
300300

@@ -315,7 +315,7 @@ public async Task CanProduceValidSmallBusinessXmlInvoice()
315315

316316
var result = await XmlInvoiceValidator.ValidateSchematron(xmlInvoice);
317317
var resultText = string.Join(Environment.NewLine, result.Validations.Select(s => $"{s.Severity}:\t{s.Message}"));
318-
Assert.IsTrue(result.Validations.Count == 0, resultText);
318+
Assert.IsEmpty(result.Validations, resultText);
319319
Assert.IsTrue(result.IsValid, resultText);
320320
}
321321
}

src/pax.XRechnung.NET.tests/XmlInvoiceTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public void CanSerialize()
135135
{
136136
var invoice = GetTestInvoice();
137137
var xmlText = XmlInvoiceWriter.Serialize(invoice);
138-
Assert.IsTrue(xmlText.Length > 0);
138+
Assert.IsGreaterThan(0, xmlText.Length);
139139

140140
// File.WriteAllText("/data/xrechnung/testinvoice2.xml", xmlText);
141141
}

src/pax.XRechnung.NET.tests/XmlValidationTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ namespace pax.XRechnung.NET.tests;
1010
[TestClass]
1111
public sealed class ValidationTests
1212
{
13-
[DataTestMethod]
13+
[TestMethod]
1414
[DataRow("02.01a-INVOICE_ubl.xml")]
1515
[DataRow("02.02a-INVOICE_ubl.xml")]
1616
[DataRow("02.03a-INVOICE_ubl.xml")]
@@ -53,9 +53,9 @@ public void XmlIsValid()
5353
XmlInvoice invoice = fixture.Create<XmlInvoice>();
5454

5555
var result = XmlInvoiceValidator.Validate(invoice);
56-
Assert.IsNull(result.Error, result.Error, result.Error);
57-
Assert.IsTrue(result.IsValid, string.Join(Environment.NewLine, result.Validations
58-
.Where(x => x.Severity == System.Xml.Schema.XmlSeverityType.Error).Select(s => s.Message)));
56+
Assert.IsNull(result.Error, result.Error, result?.Error ?? string.Empty);
57+
Assert.IsTrue(result?.IsValid, string.Join(Environment.NewLine, result?.Validations
58+
.Where(x => x.Severity == System.Xml.Schema.XmlSeverityType.Error).Select(s => s.Message) ?? []));
5959
}
6060
}
6161

src/pax.XRechnung.NET.tests/pax.XRechnung.NET.tests.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<LangVersion>latest</LangVersion>
66
<ImplicitUsings>enable</ImplicitUsings>
77
<Nullable>enable</Nullable>
88
</PropertyGroup>
99

1010
<ItemGroup>
1111
<PackageReference Include="AutoFixture" Version="4.18.1" />
12-
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
13-
<PackageReference Include="MSTest" Version="3.6.1" />
14-
</ItemGroup>
15-
16-
<ItemGroup>
17-
<Using Include="Microsoft.VisualStudio.TestTools.UnitTesting" />
12+
<PackageReference Include="MSTest" Version="4.0.2" />
1813
</ItemGroup>
1914

2015
<ItemGroup>

src/pax.XRechnung.NET/pax.XRechnung.NET.csproj

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

33
<PropertyGroup>
4-
<TargetFramework>net8.0</TargetFramework>
4+
<TargetFramework>net10.0</TargetFramework>
55
<ImplicitUsings>enable</ImplicitUsings>
66
<Nullable>enable</Nullable>
77
<Description>dotnet XRechnung import, export and validate</Description>
88
<PackageProjectUrl>https://github.com/ipax77/pax.XRechnung.NET</PackageProjectUrl>
99
<PackageReadmeFile>README.md</PackageReadmeFile>
1010
<RepositoryUrl>https://github.com/ipax77/pax.XRechnung.NET</RepositoryUrl>
1111
<PackageTags>dotnet;XRechnung;import;export;validate</PackageTags>
12-
<AssemblyVersion>0.3.1</AssemblyVersion>
12+
<AssemblyVersion>0.3.2</AssemblyVersion>
1313
<Owners>Philipp Hetzner</Owners>
1414
<Authors>Philipp Hetzner</Authors>
15-
<Version>0.3.1</Version>
16-
<FileVersion>0.3.1.0</FileVersion>
17-
<PackageVersion>0.3.1</PackageVersion>
15+
<Version>0.3.2</Version>
16+
<FileVersion>0.3.2.0</FileVersion>
17+
<PackageVersion>0.3.2</PackageVersion>
1818
<PackageLicenseExpression>MIT</PackageLicenseExpression>
1919
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
2020
<EnableNETAnalyzers>true</EnableNETAnalyzers>
2121
<AnalysisMode>All</AnalysisMode>
22-
<AnalysisLevel>8</AnalysisLevel>
22+
<AnalysisLevel>latest</AnalysisLevel>
2323
<RunAnalyzersDuringBuild>true</RunAnalyzersDuringBuild>
2424
<RunAnalyzersDuringLiveAnalysis>true</RunAnalyzersDuringLiveAnalysis>
2525
<CodeAnalysisTreatWarningsAsErrors>false</CodeAnalysisTreatWarningsAsErrors>
2626
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
2727
<GenerateDocumentationFile>true</GenerateDocumentationFile>
2828
<Nullable>enable</Nullable>
2929
<WarningsAsErrors>nullable</WarningsAsErrors>
30-
<LangVersion>12.0</LangVersion>
30+
<LangVersion>latest</LangVersion>
3131
<WarningsNotAsErrors></WarningsNotAsErrors>
3232
<DisabledWarnings></DisabledWarnings>
3333
<NoWarn>CA2227,CA1002</NoWarn>
@@ -103,7 +103,7 @@
103103
</ItemGroup>
104104

105105
<ItemGroup>
106-
<PackageReference Include="HtmlAgilityPack" Version="1.12.1" />
107-
<PackageReference Include="Microsoft.Extensions.Http" Version="8.0.1" />
106+
<PackageReference Include="HtmlAgilityPack" Version="1.12.4" />
107+
<PackageReference Include="Microsoft.Extensions.Http" Version="10.0.0" />
108108
</ItemGroup>
109109
</Project>

0 commit comments

Comments
 (0)