Files
lmxopcua/tests/Server/ZB.MOM.WW.OtOpcUa.Runtime.Tests/DataConnections/GrpcDataRootMountWireTests.cs
T

31 lines
1.5 KiB
C#

using Opc.Ua;
using Opc.Ua.Client;
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Commons.OpcUa;
using ZB.MOM.WW.OtOpcUa.Core.Abstractions.DataConnections;
namespace ZB.MOM.WW.OtOpcUa.Runtime.Tests.DataConnections;
public sealed partial class GrpcDataConfiguredDiscoveryWireTests
{
[Theory(Timeout = 90000)]
[InlineData(DataRealm.Raw)]
[InlineData(DataRealm.Uns)]
public async Task Cluster_parent_mount_is_browsable_from_the_native_realm_root(DataRealm realm)
{
using var origin = new LocalDataFixture(servingGeneration: 1, nestedCatalog: true, nestedUnsCatalog: true);
var root = realm == DataRealm.Raw ? origin.Root : origin.Uns with { Address = origin.Uns.Address with { Identifier = "Area" }, Subject = "Area" };
await WithComposedServer(origin, root, async (session, _, _, _, _, _, anchor) =>
{
// Both native realm trees hang beneath the SDK shared root in its Raw namespace.
var uri = V3NodeIds.RawNamespaceUri;
var localRoot = new NodeId(V3NodeIds.SharedRootFolderId, checked((ushort)session.NamespaceUris.GetIndex(uri)));
var references = await BrowseAll((SessionClient)session, localRoot, 10);
references.ShouldContain(x => ExpandedNodeId.ToNodeId(x.NodeId, session.NamespaceUris) == anchor);
var children = await BrowseAll((SessionClient)session, anchor, 10);
children.ShouldNotBeEmpty();
}, mountAtRealmRoot: true);
}
}