From c8a8a0959a622ce35ad1725be4ef1951ffb144fa Mon Sep 17 00:00:00 2001 From: Marc Date: Wed, 12 Aug 2026 08:04:28 +0200 Subject: [PATCH] Update the service inventory counts for the data channel Services test-ubuntu-latest-SourceGeneration.Core failed on two hardcoded counts: GetListOfServices() returned 42 rather than 39, and the Session category 7 rather than 4. Both are this PR: OpenDataChannel, ModifyDataChannel and CloseDataChannel are three new Session-category Services, so the counts moving by exactly three is the intended behaviour rather than a regression. The category test now also names the three Services it expects to find, so a future change to the figure has to say which Service moved in or out of the category instead of silently renumbering. Verified locally: the full Opc.Ua.SourceGeneration.Core.Tests suite passes, 3771 tests on net10.0. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5d026b47-265d-4c97-8715-26e207dfa03c --- .../Schema/ModelDesignValidatorTests.cs | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/tests/Opc.Ua.SourceGeneration.Core.Tests/Schema/ModelDesignValidatorTests.cs b/tests/Opc.Ua.SourceGeneration.Core.Tests/Schema/ModelDesignValidatorTests.cs index 6727d50c52..823484ee9f 100644 --- a/tests/Opc.Ua.SourceGeneration.Core.Tests/Schema/ModelDesignValidatorTests.cs +++ b/tests/Opc.Ua.SourceGeneration.Core.Tests/Schema/ModelDesignValidatorTests.cs @@ -262,7 +262,7 @@ namespace Opc.Ua.Schema.Model.Tests { ModelDesignValidator validator = CreateValidatedValidator(); - Assert.That(validator.GetListOfServices(), Has.Length.EqualTo(39)); + Assert.That(validator.GetListOfServices(), Has.Length.EqualTo(42)); } [Test] @@ -270,8 +270,24 @@ namespace Opc.Ua.Schema.Model.Tests { ModelDesignValidator validator = CreateValidatedValidator(); - Assert.That(validator.GetListOfServices(ServiceCategory.Session), Has.Length.EqualTo(4)); - Assert.That(validator.GetListOfServices(ServiceCategory.None), Is.Empty); + Service[] session = validator.GetListOfServices(ServiceCategory.Session); + + Assert.Multiple(() => + { + Assert.That(session, Has.Length.EqualTo(7)); + + // Named rather than counted alone, so a change to this figure + // has to say which Service moved in or out of the category. + Assert.That( + session.Select(service => service.Name), + Is.SupersetOf(new[] + { + "OpenDataChannel", + "ModifyDataChannel", + "CloseDataChannel" + })); + Assert.That(validator.GetListOfServices(ServiceCategory.None), Is.Empty); + }); } [TestCase(SpecificationVersion.V103)]