Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verwendungszweck Adaptions for 0.8.x branch #574

Draft
wants to merge 4 commits into
base: v0.8.x-legacy
Choose a base branch
from
Draft
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
6 changes: 5 additions & 1 deletion BO4E/ENUM/Verwendungszweck.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
using System;
using System.Runtime.Serialization;
using BO4E.meta.LenientConverters;

namespace BO4E.ENUM;

/// <summary>Verwendungungszweck der Werte Marktlokation</summary>
[System.Text.Json.Serialization.JsonConverter(
typeof(SystemTextVerwendungszweckStringEnumConverter)
)]
[Newtonsoft.Json.JsonConverter(typeof(NewtonsoftVerwendungszweckStringEnumConverter))]
public enum Verwendungszweck
{
/// <summary>Z84: Netznutzungsabrechnung</summary>
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;

namespace BO4E.meta.LenientConverters;

/// <summary>
/// Converts a stringified single <see cref="BO4E.ENUM.Verwendungszweck"/>
/// to a <see cref="BO4E.COM.Verwendungszweck"/> which has the single enum value as member in <see cref="COM.Verwendungszweck.Zweck"/>
/// </summary>
/// /// <remarks><seealso cref="SystemTextVerwendungszweckEnumToComConverter"/></remarks>
public class NewtonsoftVerwendungszweckEnumToComConverter
: Newtonsoft.Json.JsonConverter<BO4E.COM.Verwendungszweck?>
{
/// <inheritdoc />
public override bool CanWrite => false;

/// <inheritdoc />
public override void WriteJson(
JsonWriter writer,
BO4E.COM.Verwendungszweck? value,
JsonSerializer serializer
)
{
throw new NotImplementedException(
"This converter is only intended to work with deserialization; Tests show that this alone is sufficient."
);
}

/// <inheritdoc />
public override BO4E.COM.Verwendungszweck? ReadJson(
JsonReader reader,
Type objectType,
BO4E.COM.Verwendungszweck? existingValue,
bool hasExistingValue,
JsonSerializer serializer
)
{
if (reader.TokenType == JsonToken.Null)
{
return null;
}

if (reader.TokenType == JsonToken.String)
{
var result = new BO4E.COM.Verwendungszweck
{
Marktrolle = ENUM.Marktrolle.LF,
Zweck = new List<ENUM.Verwendungszweck>(),
};
var stringValue = (string)reader.Value!;
// we don't want to interfere or re-add the famous and beloved NewtonsoftVerwendungszweckStringEnumConverter
stringValue = stringValue.Replace(
"MEHRMINDERMBENGENABRECHNUNG",
"MEHRMINDERMENGENABRECHNUNG"
);
result.Zweck.Add(
(BO4E.ENUM.Verwendungszweck)
Enum.Parse(typeof(BO4E.ENUM.Verwendungszweck), stringValue)
);
return result;
}

int? stringEnumConverterIndex = null;
foreach (var converter in serializer.Converters)
{
if (converter is NewtonsoftVerwendungszweckStringEnumConverter)
{
stringEnumConverterIndex = serializer.Converters.IndexOf(converter);
break;
}
}
int? thisConverterIndex =
serializer.Converters.IndexOf(this) == -1 ? null : serializer.Converters.IndexOf(this);

if (stringEnumConverterIndex == null)
{
serializer.Converters.Add(new NewtonsoftVerwendungszweckStringEnumConverter());
;
}
if (thisConverterIndex != null)
{
serializer.Converters.RemoveAt(thisConverterIndex.Value);
}
// Delegate to the default behavior for complex objects or other token types
var objectResult = JToken.ReadFrom(reader).ToObject<BO4E.COM.Verwendungszweck>(serializer);
if (thisConverterIndex != null)
{
serializer.Converters.Insert(thisConverterIndex.Value, this);
}
if (stringEnumConverterIndex == null)
{
serializer.Converters.RemoveAt(serializer.Converters.Count - 1);
}

return objectResult;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
using System;
using System.Collections.Generic;
using System.Text.Json;
using BO4E.COM;
using JsonException = System.Text.Json.JsonException;
using JsonSerializer = System.Text.Json.JsonSerializer;

namespace BO4E.meta.LenientConverters;

/// <summary>
/// Converts a stringified single <see cref="BO4E.ENUM.Verwendungszweck"/>
/// to a <see cref="BO4E.COM.Verwendungszweck"/> which has the single enum value as member in <see cref="Verwendungszweck.Zweck"/>
/// </summary>
/// <remarks><seealso cref="NewtonsoftVerwendungszweckEnumToComConverter"/></remarks>
public class SystemTextVerwendungszweckEnumToComConverter
: System.Text.Json.Serialization.JsonConverter<Verwendungszweck?>
{
/// <inheritdoc />
public override Verwendungszweck? Read(
ref Utf8JsonReader reader,
Type typeToConvert,
JsonSerializerOptions options
)
{
if (reader.TokenType == JsonTokenType.Null)
{
return null;
}
if (reader.TokenType == JsonTokenType.String)
{
var result = new Verwendungszweck
{
Marktrolle = ENUM.Marktrolle.LF,
Zweck = new List<ENUM.Verwendungszweck>(),
};
string stringValue = reader.GetString()!;

// Adjust the string as per the Newtonsoft version
stringValue = stringValue.Replace(
"MEHRMINDERMBENGENABRECHNUNG",
"MEHRMINDERMENGENABRECHNUNG"
);

// Parse and add the enum value
if (Enum.TryParse<ENUM.Verwendungszweck>(stringValue, out var enumValue))
{
result.Zweck.Add(enumValue);
}
else
{
throw new JsonException($"Invalid Verwendungszweck value: {stringValue}");
}

return result;
}

// Delegate to the default deserialization behavior for Verwendungszweck
return JsonSerializer.Deserialize<Verwendungszweck>(
ref reader,
CloneJsonSerializerOptionsExceptThis(options)
);
}

private JsonSerializerOptions CloneJsonSerializerOptionsExceptThis(
JsonSerializerOptions options
)
{
var clonedOptions = new JsonSerializerOptions
{
AllowTrailingCommas = options.AllowTrailingCommas,
DefaultBufferSize = options.DefaultBufferSize,
DictionaryKeyPolicy = options.DictionaryKeyPolicy,
DefaultIgnoreCondition = options.DefaultIgnoreCondition,
IgnoreReadOnlyProperties = options.IgnoreReadOnlyProperties,
MaxDepth = options.MaxDepth,
PropertyNameCaseInsensitive = options.PropertyNameCaseInsensitive,
PropertyNamingPolicy = options.PropertyNamingPolicy,
ReadCommentHandling = options.ReadCommentHandling,
WriteIndented = options.WriteIndented,
};

foreach (var converter in options.Converters)
{
if (converter.GetType() == GetType())
{
// prevents stackoverflowexception
continue;
}
clonedOptions.Converters.Add(converter);
}
clonedOptions.Converters.Add(new SystemTextVerwendungszweckStringEnumConverter());
return clonedOptions;
}

/// <inheritdoc />
public override void Write(
Utf8JsonWriter writer,
Verwendungszweck? value,
JsonSerializerOptions options
)
{
JsonSerializer.Serialize(writer, value, CloneJsonSerializerOptionsExceptThis(options));
}
}
180 changes: 180 additions & 0 deletions BO4ETestProject/TestStringEnumConverter.cs
Original file line number Diff line number Diff line change
@@ -157,7 +157,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 160 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 160 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 160 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 160 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
@@ -207,7 +207,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 210 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 210 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 210 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 210 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
@@ -263,7 +263,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 266 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 266 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 266 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 266 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
@@ -318,7 +318,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 321 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 321 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 321 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 321 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
@@ -342,7 +342,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 345 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 345 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 345 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 345 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
@@ -371,7 +371,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 374 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 374 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 374 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 374 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
@@ -415,7 +415,7 @@
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 418 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 418 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 418 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 418 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck?.ToString() ?? "null");
@@ -583,4 +583,184 @@
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck.ToString());
}

public class ClassWithListOfVerwendungszweck
{
public List<Verwendungszweck>? Foo { get; set; }
}

[TestMethod]
[DataRow("MEHRMINDERMENGENABRECHNUNG", Verwendungszweck.MEHRMINDERMENGENABRECHNUNG)]
[DataRow("MEHRMINDERMBENGENABRECHNUNG", Verwendungszweck.MEHRMINDERMENGENABRECHNUNG)]
public void Test_Newtonsoft_List_of_Verwendungszweck_Conversion(
string? jsonValue,
Verwendungszweck expectedVerwendungszweck
)
{
var jsonString = "{\"Foo\": [\"" + jsonValue + "\"]}";
var result = JsonConvert.DeserializeObject<ClassWithListOfVerwendungszweck>(jsonString);
result.Should().NotBeNull();
result.Foo.Should().NotBeNullOrEmpty().And.ContainInOrder(expectedVerwendungszweck);
}

[TestMethod]
public void Test_Newtonsoft_List_of_Verwendungszweck_Conversion_With_Null()
{
var jsonString = "{\"Foo\": null}";
var result = JsonConvert.DeserializeObject<ClassWithListOfVerwendungszweck>(jsonString);
result.Should().NotBeNull();
result.Foo.Should().BeNull();
}

[TestMethod]
[DataRow("MEHRMINDERMENGENABRECHNUNG", Verwendungszweck.MEHRMINDERMENGENABRECHNUNG)]
[DataRow("MEHRMINDERMBENGENABRECHNUNG", Verwendungszweck.MEHRMINDERMENGENABRECHNUNG)]
public void Test_SystemText_List_of_Verwendungszweck_Conversion(
string? jsonValue,
Verwendungszweck expectedVerwendungszweck
)
{
var jsonString = "{\"Foo\": [\"" + jsonValue + "\"]}";
var result = JsonSerializer.Deserialize<ClassWithListOfVerwendungszweck>(jsonString);
result.Should().NotBeNull();
result.Foo.Should().NotBeNullOrEmpty().And.ContainInOrder(expectedVerwendungszweck);
}

[TestMethod]
public void Test_SystemText_List_of_Verwendungszweck_Conversion_With_Null()
{
var jsonString = "{\"Foo\": null}";
var result = JsonSerializer.Deserialize<ClassWithListOfVerwendungszweck>(jsonString);
result.Should().NotBeNull();
result.Foo.Should().BeNull();
}

public class ClassWithComVerwendungszweck
{
public BO4E.COM.Verwendungszweck? Foo { get; set; }
}

public class ClassWithAnnotatedComVerwendungszweck
{
[System.Text.Json.Serialization.JsonConverter(
typeof(SystemTextVerwendungszweckEnumToComConverter)
)]
[Newtonsoft.Json.JsonConverter(typeof(NewtonsoftVerwendungszweckEnumToComConverter))]
public BO4E.COM.Verwendungszweck? Foo { get; set; }
}

[TestMethod]
[DataRow("{\"Foo\": \"MEHRMINDERMENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": \"MEHRMINDERMBENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMENGENABRECHNUNG\"]}}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMBENGENABRECHNUNG\"]}}")]
public void Test_Newtonsoft_VerwendungszweckEnum_To_COM_Converter(string jsonString)
{
var settings = new Newtonsoft.Json.JsonSerializerSettings
{
Converters = new List<Newtonsoft.Json.JsonConverter>
{
new NewtonsoftVerwendungszweckEnumToComConverter(),
},
};
var result = JsonConvert.DeserializeObject<ClassWithComVerwendungszweck>(
jsonString,
settings
);
result
.Should()
.NotBeNull()
.And.Subject.As<ClassWithComVerwendungszweck>()
.Foo?.Zweck.Should()
.NotBeNull()
.And.ContainEquivalentOf(BO4E.ENUM.Verwendungszweck.MEHRMINDERMENGENABRECHNUNG);

settings.Converters.Add(new StringEnumConverter());
var reSerializedJsonString = JsonConvert.SerializeObject(result, settings);
reSerializedJsonString.Should().Contain("MEHRMINDERMENGENABRECHNUNG");
}

[TestMethod]
[DataRow("{\"Foo\": \"MEHRMINDERMENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": \"MEHRMINDERMBENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMENGENABRECHNUNG\"]}}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMBENGENABRECHNUNG\"]}}")]
public void Test_Newtonsoft_VerwendungszweckEnum_To_COM_Converter_With_Annotated_Property(
string jsonString
)
{
var result = JsonConvert.DeserializeObject<ClassWithAnnotatedComVerwendungszweck>(
jsonString
);
result
.Should()
.NotBeNull()
.And.Subject.As<ClassWithAnnotatedComVerwendungszweck>()
.Foo?.Zweck.Should()
.NotBeNull()
.And.ContainEquivalentOf(BO4E.ENUM.Verwendungszweck.MEHRMINDERMENGENABRECHNUNG);
var reSerializedJsonString = JsonConvert.SerializeObject(
result,
new JsonSerializerSettings
{
Converters = new List<Newtonsoft.Json.JsonConverter> { new StringEnumConverter() },
}
);
reSerializedJsonString.Should().Contain("MEHRMINDERMENGENABRECHNUNG");
}

[TestMethod]
[DataRow("{\"Foo\": \"MEHRMINDERMENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": \"MEHRMINDERMBENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMENGENABRECHNUNG\"]}}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMBENGENABRECHNUNG\"]}}")]
public void Test_STJ_VerwendungszweckEnum_To_COM_Converter(string jsonString)
{
var settings = new System.Text.Json.JsonSerializerOptions()
{
Converters =
{
new SystemTextVerwendungszweckStringEnumConverter(),
new SystemTextVerwendungszweckEnumToComConverter(),
},
};
var result = System.Text.Json.JsonSerializer.Deserialize<ClassWithComVerwendungszweck>(
jsonString,
settings
);
result
.Should()
.NotBeNull()
.And.Subject.As<ClassWithComVerwendungszweck>()
.Foo?.Zweck.Should()
.NotBeNull()
.And.ContainEquivalentOf(BO4E.ENUM.Verwendungszweck.MEHRMINDERMENGENABRECHNUNG);

var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(result, settings);
reSerializedJsonString.Should().Contain("MEHRMINDERMENGENABRECHNUNG");
}

[TestMethod]
[DataRow("{\"Foo\": \"MEHRMINDERMENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": \"MEHRMINDERMBENGENABRECHNUNG\"}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMENGENABRECHNUNG\"]}}")]
[DataRow("{\"Foo\": {\"zweck\":[\"MEHRMINDERMBENGENABRECHNUNG\"]}}")]
public void Test_STJ_VerwendungszweckEnum_To_COM_Converter_With_Annotated_Property(
string jsonString
)
{
var result =
System.Text.Json.JsonSerializer.Deserialize<ClassWithAnnotatedComVerwendungszweck>(
jsonString
);
result
.Should()
.NotBeNull()
.And.Subject.As<ClassWithAnnotatedComVerwendungszweck>()
.Foo?.Zweck.Should()
.NotBeNull()
.And.ContainEquivalentOf(BO4E.ENUM.Verwendungszweck.MEHRMINDERMENGENABRECHNUNG);
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(result);
reSerializedJsonString.Should().Contain("MEHRMINDERMENGENABRECHNUNG");
}
}

Unchanged files with check annotations Beta

public class TestSperrauftrag
{
private readonly JsonSerializerOptions _options =
new() { Converters = { new JsonStringEnumConverter() }, IgnoreNullValues = true };

Check warning on line 20 in BO4ETestProject/TestSperrauftrag.cs

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 20 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / pushfeature

'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 20 in BO4ETestProject/TestSperrauftrag.cs

GitHub Actions / pushfeature

'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 20 in BO4ETestProject/TestSperrauftrag.cs

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]
public void TestSperrauftragSerializationMaximal()
// BusinessObjects
typeof(Auftrag),
typeof(AuftragsStorno),

Check warning on line 43 in BO4ETestProject/TestJsonOrder.cs

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 43 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

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

Check warning on line 43 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

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

Check warning on line 43 in BO4ETestProject/TestJsonOrder.cs

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),
typeof(PreisblattUmlagen),
typeof(Region),
typeof(Sperrauftrag),
typeof(SperrauftragsStorno),

Check warning on line 58 in BO4ETestProject/TestJsonOrder.cs

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 58 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

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

Check warning on line 58 in BO4ETestProject/TestJsonOrder.cs

GitHub Actions / pushfeature

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

Check warning on line 58 in BO4ETestProject/TestJsonOrder.cs

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),