Skip to content

Commit 3ad7c6b

Browse files
authored
Merge pull request #9 from ipax77/dotnet10
update to dotnet 10
2 parents f481ebe + 7611c6b commit 3ad7c6b

File tree

11 files changed

+40
-39
lines changed

11 files changed

+40
-39
lines changed

.github/workflows/dotnet.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ jobs:
1515
runs-on: ubuntu-latest
1616

1717
steps:
18-
- uses: actions/checkout@v4
18+
- uses: actions/checkout@v5
1919
- name: Setup .NET
20-
uses: actions/setup-dotnet@v4
20+
uses: actions/setup-dotnet@v5
2121
with:
22-
dotnet-version: 8.0.x
22+
dotnet-version: 10.0.x
2323
- name: Restore dependencies
2424
run: dotnet restore
2525
- name: Build

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>

0 commit comments

Comments
 (0)