test(historian-gateway): cover MaxTieClusterOverfetch warning + refresh AddServerHistorian doc
Addresses Task 9 review: add the enabled+nonpositive MaxTieClusterOverfetch warning test; update the AddServerHistorian XML doc to describe the gateway-backed data source (the alarm-path Wonderware doc stays until T13). Claude-Session: https://claude.ai/code/session_012SDSQ3AcaXqPcBtDESBRii
This commit is contained in:
@@ -104,17 +104,17 @@ public static class ServiceCollectionExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Config-gated server-side HistoryRead backend. When the <c>ServerHistorian</c> section has
|
/// Config-gated server-side HistoryRead backend. When the <c>ServerHistorian</c> section has
|
||||||
/// <c>Enabled=true</c>, registers the <paramref name="dataSourceFactory"/>-supplied
|
/// <c>Enabled=true</c>, registers the <paramref name="dataSourceFactory"/>-supplied
|
||||||
/// <see cref="IHistorianDataSource"/> (the read-only Wonderware client) overriding the
|
/// <see cref="IHistorianDataSource"/> (the read-only HistorianGateway-backed data source) overriding
|
||||||
/// <see cref="NullHistorianDataSource"/> default from <see cref="AddOtOpcUaRuntime"/>. Otherwise
|
/// the <see cref="NullHistorianDataSource"/> default from <see cref="AddOtOpcUaRuntime"/>. Otherwise
|
||||||
/// a no-op (the Null default stays and the node manager's HistoryRead returns
|
/// a no-op (the Null default stays and the node manager's HistoryRead returns
|
||||||
/// <c>GoodNoData</c>-empty). The data source is injected so the Wonderware client can be supplied
|
/// <c>GoodNoData</c>-empty). The data source is injected so the gateway-backed client can be supplied
|
||||||
/// by the Host, which is the only project that references it.
|
/// by the Host, which is the only project that references the driver.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="services">The service collection to register with.</param>
|
/// <param name="services">The service collection to register with.</param>
|
||||||
/// <param name="configuration">The configuration carrying the <c>ServerHistorian</c> section.</param>
|
/// <param name="configuration">The configuration carrying the <c>ServerHistorian</c> section.</param>
|
||||||
/// <param name="dataSourceFactory">
|
/// <param name="dataSourceFactory">
|
||||||
/// Factory the Host supplies to build the concrete read <see cref="IHistorianDataSource"/>
|
/// Factory the Host supplies to build the concrete read <see cref="IHistorianDataSource"/>
|
||||||
/// (the Wonderware client) from the bound options + the resolving provider.
|
/// (the gateway-backed data source) from the bound options + the resolving provider.
|
||||||
/// </param>
|
/// </param>
|
||||||
/// <returns>The same <paramref name="services"/> instance for chaining.</returns>
|
/// <returns>The same <paramref name="services"/> instance for chaining.</returns>
|
||||||
public static IServiceCollection AddServerHistorian(
|
public static IServiceCollection AddServerHistorian(
|
||||||
|
|||||||
@@ -31,4 +31,13 @@ public sealed class ServerHistorianOptionsTests
|
|||||||
[Fact]
|
[Fact]
|
||||||
public void Valid_config_is_clean()
|
public void Valid_config_is_clean()
|
||||||
=> Assert.Empty(new ServerHistorianOptions { Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y" }.Validate());
|
=> Assert.Empty(new ServerHistorianOptions { Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y" }.Validate());
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void Enabled_with_nonpositive_MaxTieClusterOverfetch_warns()
|
||||||
|
{
|
||||||
|
var w = new ServerHistorianOptions
|
||||||
|
{ Enabled = true, Endpoint = "https://h:5222", ApiKey = "histgw_x_y", MaxTieClusterOverfetch = 0 }
|
||||||
|
.Validate();
|
||||||
|
Assert.Contains(w, m => m.Contains("MaxTieClusterOverfetch"));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user