Skip to content

Commit a08ab66

Browse files
authored
Fix broken unit tests introduced in 0.5.6 (#187)
1 parent 5b2472c commit a08ab66

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/CsharpClient/QuixStreams.State/ScalarState.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,9 @@ public void Clear()
328328
/// <returns>Returns the value</returns>
329329
public T Value
330330
{
331-
get => genericConverter(this.inMemoryValue);
331+
get => this.inMemoryValue == null
332+
? default
333+
: genericConverter(this.inMemoryValue);
332334
set => this.inMemoryValue = stateValueConverter(value);
333335
}
334336

src/CsharpClient/QuixStreams.Telemetry.UnitTests/Models/Telemetry/CodecRegistryShould.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public void Register_CompactJsonForBetterPerformance_ShouldRegisterAsExpected()
4242
var codecs = Transport.Registry.CodecRegistry.RetrieveCodecs(new ModelKey("TimeseriesData"));
4343
codecs.Count().Should().Be(3);
4444
codecs.Should().Contain(x => x is TimeseriesDataReadableCodec); // for reading
45-
codecs.Should().Contain(x => x is TimeseriesDataJsonCodec); // for reading
45+
codecs.Should().Contain(x => x is DefaultJsonCodec<TimeseriesDataRaw>); // for reading
4646
codecs.Should().Contain(x => x is TimeseriesDataProtobufCodec); // for reading
4747
codecs.First().GetType().Should().Be(typeof(TimeseriesDataReadableCodec)); // for writing
4848
}
@@ -57,9 +57,9 @@ public void Register_JsonTimeseriesData_ShouldRegisterAsExpected()
5757
var codecs = Transport.Registry.CodecRegistry.RetrieveCodecs(new ModelKey("TimeseriesData"));
5858
codecs.Count().Should().Be(3);
5959
codecs.Should().Contain(x => x is TimeseriesDataReadableCodec); // for reading
60-
codecs.Should().Contain(x => x is TimeseriesDataJsonCodec); // for reading
60+
codecs.Should().Contain(x => x is DefaultJsonCodec<TimeseriesDataRaw>); // for reading
6161
codecs.Should().Contain(x => x is TimeseriesDataProtobufCodec); // for reading
62-
codecs.First().GetType().Should().Be(typeof(TimeseriesDataJsonCodec)); // for writing
62+
codecs.First().GetType().Should().Be(typeof(DefaultJsonCodec<TimeseriesDataRaw>)); // for writing
6363
}
6464

6565
[Fact]

0 commit comments

Comments
 (0)