chore: organize solution into module folders (Core/Server/Drivers/Client/Tooling)

Group all 69 projects into category subfolders under src/ and tests/ so the
Rider Solution Explorer mirrors the module structure. Folders: Core, Server,
Drivers (with a nested Driver CLIs subfolder), Client, Tooling.

- Move every project folder on disk with git mv (history preserved as renames).
- Recompute relative paths in 57 .csproj files: cross-category ProjectReferences,
  the lib/ HintPath+None refs in Driver.Historian.Wonderware, and the external
  mxaccessgw refs in Driver.Galaxy and its test project.
- Rebuild ZB.MOM.WW.OtOpcUa.slnx with nested solution folders.
- Re-prefix project paths in functional scripts (e2e, compliance, smoke SQL,
  integration, install).

Build green (0 errors); unit tests pass. Docs left for a separate pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Joseph Doherty
2026-05-17 01:55:28 -04:00
parent 69f02fed7f
commit a25593a9c6
1044 changed files with 365 additions and 343 deletions

View File

@@ -0,0 +1,155 @@
using Shouldly;
using Xunit;
using ZB.MOM.WW.OtOpcUa.Client.UI.Services;
using ZB.MOM.WW.OtOpcUa.Client.UI.Tests.Fakes;
using ZB.MOM.WW.OtOpcUa.Client.UI.ViewModels;
using BrowseResult = ZB.MOM.WW.OtOpcUa.Client.Shared.Models.BrowseResult;
namespace ZB.MOM.WW.OtOpcUa.Client.UI.Tests;
public class BrowseTreeViewModelTests
{
private readonly SynchronousUiDispatcher _dispatcher;
private readonly FakeOpcUaClientService _service;
private readonly BrowseTreeViewModel _vm;
public BrowseTreeViewModelTests()
{
_service = new FakeOpcUaClientService
{
BrowseResults =
[
new BrowseResult("ns=2;s=Node1", "Node1", "Object", true),
new BrowseResult("ns=2;s=Node2", "Node2", "Variable", false)
]
};
_dispatcher = new SynchronousUiDispatcher();
_vm = new BrowseTreeViewModel(_service, _dispatcher);
}
[Fact]
public async Task LoadRootsAsync_PopulatesRootNodes()
{
await _vm.LoadRootsAsync();
_vm.RootNodes.Count.ShouldBe(2);
_vm.RootNodes[0].DisplayName.ShouldBe("Node1");
_vm.RootNodes[1].DisplayName.ShouldBe("Node2");
}
[Fact]
public async Task LoadRootsAsync_BrowsesWithNullParent()
{
await _vm.LoadRootsAsync();
_service.BrowseCallCount.ShouldBe(1);
_service.LastBrowseParentNodeId.ShouldBeNull();
}
[Fact]
public void Clear_RemovesAllRootNodes()
{
_vm.RootNodes.Add(new TreeNodeViewModel("ns=2;s=X", "X", "Object", false, _service, _dispatcher));
_vm.Clear();
_vm.RootNodes.ShouldBeEmpty();
}
[Fact]
public async Task LoadRootsAsync_NodeWithChildren_HasPlaceholder()
{
await _vm.LoadRootsAsync();
var nodeWithChildren = _vm.RootNodes[0];
nodeWithChildren.HasChildren.ShouldBeTrue();
nodeWithChildren.Children.Count.ShouldBe(1);
nodeWithChildren.Children[0].IsPlaceholder.ShouldBeTrue();
}
[Fact]
public async Task LoadRootsAsync_NodeWithoutChildren_HasNoPlaceholder()
{
await _vm.LoadRootsAsync();
var leafNode = _vm.RootNodes[1];
leafNode.HasChildren.ShouldBeFalse();
leafNode.Children.ShouldBeEmpty();
}
[Fact]
public async Task TreeNode_FirstExpand_TriggersChildBrowse()
{
_service.BrowseResults =
[
new BrowseResult("ns=2;s=Parent", "Parent", "Object", true)
];
await _vm.LoadRootsAsync();
// Reset browse results for child browse
_service.BrowseResults =
[
new BrowseResult("ns=2;s=Child1", "Child1", "Variable", false)
];
var parent = _vm.RootNodes[0];
var initialBrowseCount = _service.BrowseCallCount;
parent.IsExpanded = true;
// Allow async operation to complete
await Task.Delay(50);
_service.BrowseCallCount.ShouldBe(initialBrowseCount + 1);
parent.Children.Count.ShouldBe(1);
parent.Children[0].DisplayName.ShouldBe("Child1");
}
[Fact]
public async Task TreeNode_SecondExpand_DoesNotBrowseAgain()
{
_service.BrowseResults =
[
new BrowseResult("ns=2;s=Parent", "Parent", "Object", true)
];
await _vm.LoadRootsAsync();
_service.BrowseResults =
[
new BrowseResult("ns=2;s=Child1", "Child1", "Variable", false)
];
var parent = _vm.RootNodes[0];
parent.IsExpanded = true;
await Task.Delay(50);
var browseCountAfterFirst = _service.BrowseCallCount;
parent.IsExpanded = false;
parent.IsExpanded = true;
await Task.Delay(50);
_service.BrowseCallCount.ShouldBe(browseCountAfterFirst);
}
[Fact]
public async Task TreeNode_IsLoading_TransitionsDuringBrowse()
{
_service.BrowseResults =
[
new BrowseResult("ns=2;s=Parent", "Parent", "Object", true)
];
await _vm.LoadRootsAsync();
_service.BrowseResults = [];
var parent = _vm.RootNodes[0];
parent.IsExpanded = true;
await Task.Delay(50);
// After completion, IsLoading should be false
parent.IsLoading.ShouldBeFalse();
}
}