test(historian): gateway writer acks an all-non-numeric batch without a call; fix stale writer docs
Claude-Session: https://claude.ai/code/session_01Ef2ozxS7QPanGT8uoATbTe
This commit is contained in:
+18
@@ -73,6 +73,24 @@ public sealed class GatewayHistorianValueWriterTests
|
||||
Assert.False(ok);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task All_non_numeric_batch_is_acked_without_calling_the_gateway()
|
||||
{
|
||||
// A soft-failure ack: had the writer called the gateway, the result would be false.
|
||||
var fake = new FakeHistorianGatewayClient { WriteLiveValuesResult = new WriteAck { Success = false, Queued = false } };
|
||||
var values = new[]
|
||||
{
|
||||
new HistorizationValue(DateTime.UtcNow, HistorianValue.FromString("text"), 0u),
|
||||
new HistorizationValue(DateTime.UtcNow, HistorianValue.FromDateTime(DateTime.UtcNow), 0u),
|
||||
new HistorizationValue(DateTime.UtcNow, HistorianValue.Empty, 0x80310000u),
|
||||
};
|
||||
|
||||
var ok = await Writer(fake).WriteLiveValuesAsync("T", values, TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.True(ok);
|
||||
Assert.Equal(0, fake.WriteLiveValuesCallCount);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public async Task Empty_batch_is_trivially_acked_without_calling_the_gateway()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user