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

BO Netzlokation: Make NetzlokationsId and Sparte nullable #494

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
4 changes: 2 additions & 2 deletions BO4E/BO/Netzlokation.cs
Original file line number Diff line number Diff line change
@@ -26,14 +26,14 @@ public class Netzlokation : BusinessObject
[DataCategory(DataCategory.POD)]
[BoKey]
[ProtoMember(4)]
public string NetzlokationsId { get; set; }
public string? NetzlokationsId { get; set; }

/// <summary>Sparte der Netzlokation, z.B. Gas oder Strom.</summary>
[JsonProperty(Order = 11, PropertyName = "sparte")]
[JsonPropertyOrder(11)]
[JsonPropertyName("sparte")]
[ProtoMember(5)]
public Sparte Sparte { get; set; }
public Sparte? Sparte { get; set; }

/// <summary>
/// Netzanschlussleistungsmenge der Netzlokation

Unchanged files with check annotations Beta

private readonly JsonSerializerOptions _options = new()
{
Converters = { new JsonStringEnumConverter() },
IgnoreNullValues = true,

Check warning on line 22 in BO4ETestProject/TestSperrauftrag.cs

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

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

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 22 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)
};
[TestMethod]
// BusinessObjects
typeof(Auftrag),
typeof(AuftragsStorno),

Check warning on line 42 in BO4ETestProject/TestJsonOrder.cs

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

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

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 42 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'
typeof(Avis),
typeof(Benachrichtigung),
typeof(Berechnungsformel),
typeof(PreisblattUmlagen),
typeof(Region),
typeof(Sperrauftrag),
typeof(SperrauftragsStorno),

Check warning on line 57 in BO4ETestProject/TestJsonOrder.cs

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

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

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 57 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'
// COMponents
typeof(Abweichung),
typeof(AufAbschlag),
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 164 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 214 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 270 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 325 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 349 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedGasqualitaet);

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 378 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = Newtonsoft.Json.JsonConvert.SerializeObject(actual, settings);
reSerializedJsonString.Should().Contain(expectedGasqualitaet.ToString());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (8.0.401)

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.

Check warning on line 422 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / pushfeature

Dereference of a possibly null reference.
var reSerializedJsonString = System.Text.Json.JsonSerializer.Serialize(actual, settings);
reSerializedJsonString.Should().Contain(expectedVerwendungszweck?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 455 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 455 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());
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 494 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 494 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(expectedVerwendungszweck?.ToString() ?? "null");
settings
);
actual.Should().NotBeNull();
actual.Foo.Should().Be(expectedVerwendungszweck);

Check warning on line 523 in BO4ETestProject/TestStringEnumConverter.cs

GitHub Actions / unittest (9)

Dereference of a possibly null reference.

Check warning on line 523 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(expectedVerwendungszweck.ToString());