Skip to content

Commit

Permalink
Fix broken unit tests introduced in 0.5.6 (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter-quix authored Sep 20, 2023
1 parent 5b2472c commit a08ab66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion src/CsharpClient/QuixStreams.State/ScalarState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,9 @@ public void Clear()
/// <returns>Returns the value</returns>
public T Value
{
get => genericConverter(this.inMemoryValue);
get => this.inMemoryValue == null
? default
: genericConverter(this.inMemoryValue);
set => this.inMemoryValue = stateValueConverter(value);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public void Register_CompactJsonForBetterPerformance_ShouldRegisterAsExpected()
var codecs = Transport.Registry.CodecRegistry.RetrieveCodecs(new ModelKey("TimeseriesData"));
codecs.Count().Should().Be(3);
codecs.Should().Contain(x => x is TimeseriesDataReadableCodec); // for reading
codecs.Should().Contain(x => x is TimeseriesDataJsonCodec); // for reading
codecs.Should().Contain(x => x is DefaultJsonCodec<TimeseriesDataRaw>); // for reading
codecs.Should().Contain(x => x is TimeseriesDataProtobufCodec); // for reading
codecs.First().GetType().Should().Be(typeof(TimeseriesDataReadableCodec)); // for writing
}
Expand All @@ -57,9 +57,9 @@ public void Register_JsonTimeseriesData_ShouldRegisterAsExpected()
var codecs = Transport.Registry.CodecRegistry.RetrieveCodecs(new ModelKey("TimeseriesData"));
codecs.Count().Should().Be(3);
codecs.Should().Contain(x => x is TimeseriesDataReadableCodec); // for reading
codecs.Should().Contain(x => x is TimeseriesDataJsonCodec); // for reading
codecs.Should().Contain(x => x is DefaultJsonCodec<TimeseriesDataRaw>); // for reading
codecs.Should().Contain(x => x is TimeseriesDataProtobufCodec); // for reading
codecs.First().GetType().Should().Be(typeof(TimeseriesDataJsonCodec)); // for writing
codecs.First().GetType().Should().Be(typeof(DefaultJsonCodec<TimeseriesDataRaw>)); // for writing
}

[Fact]
Expand Down

0 comments on commit a08ab66

Please sign in to comment.