Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Collections.Generic;
using System.Text.Json;
using AwesomeAssertions;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestBO4E;
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestAutoNumberConverter.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.IO;
using AwesomeAssertions;
using BO4E.BO;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using JsonSerializer = System.Text.Json.JsonSerializer;

Expand Down
170 changes: 85 additions & 85 deletions BO4ETestProject/TestBO4E.csproj
Original file line number Diff line number Diff line change
@@ -1,85 +1,85 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<RootNamespace>TestBO4E-dotnet</RootNamespace>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" Version="8.1.0" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="JsonDiffPatch.Net" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.11.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.11.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BO4E\BO4E.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="bo4eURITests\ansprechpartner_vorname.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\ansprechpartner_vorname_null.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\marktlokation_simple.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\marktteilnehmer.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\geschaeftspartner_non_lenient_enumlist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_with_typenamehandling.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\rechnung.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\energiemenge_empty_verbrauch.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\energiemenge_lenient_datetime.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\geschaeftspartner_lenient_enumlist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_broken_gasqualitaet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\messlokation_userProps.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\messlokation_hf_sap.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_simple.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\Vertrag_lenient_String.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\weatherforecast.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\vertrag_numeric_versionstruktur.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\zähler2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\zähler.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<IsPackable>false</IsPackable>
<ApplicationIcon />
<OutputType>Library</OutputType>
<StartupObject />
<RootNamespace>TestBO4E-dotnet</RootNamespace>
<LangVersion>12</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AwesomeAssertions" Version="9.2.1" />
<PackageReference Include="coverlet.collector" Version="6.0.4">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="JsonDiffPatch.Net" Version="2.4.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.13.0" />
<PackageReference Include="MSTest.TestAdapter" Version="3.11.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.11.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\BO4E\BO4E.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="bo4eURITests\ansprechpartner_vorname.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\ansprechpartner_vorname_null.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\marktlokation_simple.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="bo4eURITests\marktteilnehmer.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\geschaeftspartner_non_lenient_enumlist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_with_typenamehandling.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\rechnung.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\energiemenge_empty_verbrauch.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\energiemenge_lenient_datetime.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\geschaeftspartner_lenient_enumlist.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_broken_gasqualitaet.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\messlokation_userProps.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\messlokation_hf_sap.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\marktlokation_simple.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="BoMapperTests\Vertrag_lenient_String.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\weatherforecast.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\vertrag_numeric_versionstruktur.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\zähler2.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="testjsons\zähler.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
2 changes: 1 addition & 1 deletion BO4ETestProject/TestEnumMembers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using AwesomeAssertions;
using BO4E.ENUM;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Converters;

Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestEnums.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using System.Reflection;
using FluentAssertions;
using AwesomeAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestBO4E;
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestGeraetemerkmalConverter.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Collections.Generic;
using System.Text.Json.Serialization;
using AwesomeAssertions;
using BO4E.ENUM;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using JsonException = System.Text.Json.JsonException;
Expand Down Expand Up @@ -36,7 +36,7 @@
{
var errorAction = () =>
Newtonsoft.Json.JsonConvert.DeserializeObject<SomethingWithAGeraetemerkmal>(JsonString);
errorAction

Check warning on line 39 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)

Check warning on line 39 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)

Check warning on line 39 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)

Check warning on line 39 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)
.Should()
.Throw<JsonSerializationException>()
.Which.Message.StartsWith("Error converting value \"G4\" to type");
Expand All @@ -47,7 +47,7 @@
{
var errorAction = () =>
System.Text.Json.JsonSerializer.Deserialize<SomethingWithAGeraetemerkmal>(JsonString);
errorAction

Check warning on line 50 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)

Check warning on line 50 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)

Check warning on line 50 in BO4ETestProject/TestGeraetemerkmalConverter.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

The return value of 'StartsWith' should not be ignored (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0055)
.Should()
.Throw<JsonException>()
.Which.Message.StartsWith(
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestJsonOrder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
using System.Linq;
using System.Reflection;
using System.Text.Json.Serialization;
using AwesomeAssertions;
using BO4E.BO;
using BO4E.COM;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using JsonIgnoreAttribute = System.Text.Json.Serialization.JsonIgnoreAttribute;
Expand Down Expand Up @@ -39,7 +39,7 @@

// BusinessObjects
typeof(Auftrag),
typeof(AuftragsStorno),

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'AuftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'
typeof(Avis),
typeof(Benachrichtigung),
typeof(Berechnungsformel),
Expand All @@ -54,7 +54,7 @@
typeof(PreisblattUmlagen),
typeof(Region),
typeof(Sperrauftrag),
typeof(SperrauftragsStorno),

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'SperrauftragsStorno' is obsolete: 'This is not used in the implementation of the blocking process - we use the enum Auftragsstornogrund instead'
// COMponents
typeof(Abweichung),
typeof(AufAbschlag),
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestJsonSchemaGeneration.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Linq;
using AwesomeAssertions;
using BO4E.BO;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json.Schema;

Expand All @@ -26,7 +26,7 @@
[TestMethod]
public void NegativeTest()
{
Assert.ThrowsException<ArgumentException>(

Check warning on line 29 in BO4ETestProject/TestJsonSchemaGeneration.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

Use 'Assert.ThrowsExactly' instead of 'Assert.ThrowsException' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0039)

Check warning on line 29 in BO4ETestProject/TestJsonSchemaGeneration.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

Use 'Assert.ThrowsExactly' instead of 'Assert.ThrowsException' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0039)

Check warning on line 29 in BO4ETestProject/TestJsonSchemaGeneration.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

Use 'Assert.ThrowsExactly' instead of 'Assert.ThrowsException' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0039)
() => BusinessObject.GetJsonSchema(typeof(string)),
"Illegal types must result in a ArgumentException."
);
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestLinkExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using System;
using System.Collections.Generic;
using System.Linq;
using AwesomeAssertions;
using BO4E.Marktkommunikation;
using BO4E.Marktkommunikation.v2;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestBO4E;
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestNullableDateTimeOffsetConverter.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;
using AwesomeAssertions;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestBO4E;
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestProtobufSerialization.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.Collections.Generic;
using System.IO;
using AwesomeAssertions;
using BO4E.BO;
using BO4E.COM;
using BO4E.ENUM;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using ProtoBuf;

Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestSperrauftrag.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using AwesomeAssertions;
using BO4E.BO;
using BO4E.COM;
using BO4E.ENUM;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace TestBO4E;
Expand All @@ -19,7 +19,7 @@
private readonly JsonSerializerOptions _options = new()
{
Converters = { new JsonStringEnumConverter() },
IgnoreNullValues = true,

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

View workflow job for this annotation

GitHub Actions / unittest (8.0.401)

'JsonSerializerOptions.IgnoreNullValues' is obsolete: 'JsonSerializerOptions.IgnoreNullValues is obsolete. To ignore null values when serializing, set DefaultIgnoreCondition to JsonIgnoreCondition.WhenWritingNull.' (https://aka.ms/dotnet-warnings/SYSLIB0020)
};

[TestMethod]
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestStringEnumConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
using System.Runtime.Serialization;
using System.Text.Json;
using System.Text.Json.Serialization;
using AwesomeAssertions;
using BO4E.ENUM;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestUserProperties.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
using System.Collections.Generic;
using System.IO;
using System.Text.Json;
using AwesomeAssertions;
using BO4E;
using BO4E.BO;
using BO4E.COM;
using BO4E.ENUM;
using BO4E.meta.LenientConverters;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using JsonSerializer = System.Text.Json.JsonSerializer;
Expand Down Expand Up @@ -107,7 +107,7 @@
melo.UserProperties = null;
Assert.IsFalse(melo.UserPropertyEquals("there are no user properties", "asd"));
Assert.IsFalse(melo.TryGetUserProperty("there are no user properties", out string _));
Assert.ThrowsException<ArgumentNullException>(() =>

Check warning on line 110 in BO4ETestProject/TestUserProperties.cs

View workflow job for this annotation

GitHub Actions / unittest (9)

Use 'Assert.ThrowsExactly' instead of 'Assert.ThrowsException' (https://learn.microsoft.com/dotnet/core/testing/mstest-analyzers/mstest0039)
melo.EvaluateUserProperty<string, bool, Messlokation>(
"there are no user properties",
_ => default
Expand Down
2 changes: 1 addition & 1 deletion BO4ETestProject/TestZeitraumDeserialization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Text.Json;
using System.Text.Json.Serialization;
using AwesomeAssertions;
using BO4E.COM;
using FluentAssertions;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
Expand Down
Loading
Loading