diff --git a/mocha-common b/mocha-common index be11f42..12ac9ab 160000 --- a/mocha-common +++ b/mocha-common @@ -1 +1 @@ -Subproject commit be11f42a37a0845286dc522c47d802ac2977a7ee +Subproject commit 12ac9ab8c068f850ec7a3850e95562accbe91725 diff --git a/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs b/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs index b4111d1..09b38b9 100755 --- a/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs +++ b/mocha-dotnet/src/lib/Mocha.Core/KnownInstanceGuids.cs @@ -204,7 +204,8 @@ namespace Mocha.Core } public static class ConditionalSelectAttribute { - public static Guid Method__get__Method_Abbreviation { get; } = new Guid("{f0c64709-385d-481b-8f58-83e507fb261c}"); + // public static Guid Method__get__Method_Abbreviation { get; } = new Guid("{f0c64709-385d-481b-8f58-83e507fb261c}"); + public static Guid Method__get__Method_Abbreviation { get; } = new Guid("{ddb62bd1-df5a-4c9d-9991-ff9a827717e9}"); public static Guid Method_Binding__get__Method_Binding_Abbreviation { get; } = new Guid("{7154cb08-0f80-4af4-bca5-c2c12e54479a}"); } public static class GetAttributeBySystemRoutine diff --git a/mocha-dotnet/src/lib/Mocha.Core/Oms.cs b/mocha-dotnet/src/lib/Mocha.Core/Oms.cs index 6291dd1..f7e6798 100644 --- a/mocha-dotnet/src/lib/Mocha.Core/Oms.cs +++ b/mocha-dotnet/src/lib/Mocha.Core/Oms.cs @@ -258,7 +258,7 @@ public abstract class Oms { return ih; } - throw new KeyNotFoundException(); + throw new KeyNotFoundException("inst not found: " + globalIdentifier.ToString("b")); } protected abstract IReadOnlyCollection GetRelatedInstancesInternal(InstanceHandle source, InstanceHandle relationship, DateTime effectiveDate); diff --git a/mocha-dotnet/tests/Mocha.Core.Tests/MethodTests/ConditionalSelectAttributeMethodTests.cs b/mocha-dotnet/tests/Mocha.Core.Tests/MethodTests/ConditionalSelectAttributeMethodTests.cs index 8f1b2ac..53d7cc1 100644 --- a/mocha-dotnet/tests/Mocha.Core.Tests/MethodTests/ConditionalSelectAttributeMethodTests.cs +++ b/mocha-dotnet/tests/Mocha.Core.Tests/MethodTests/ConditionalSelectAttributeMethodTests.cs @@ -22,6 +22,39 @@ namespace Mocha.Core.Tests.MethodTests; public class ConditionalSelectAttributeMethodTests : MethodTestsBase { + public static IEnumerable Get_Method_Abbreviation__Cases + { + get + { + yield return new TestCaseData(KnownInstanceGuids.MethodClasses.AssignAttributeMethod).Returns("AA"); + yield return new TestCaseData(KnownInstanceGuids.MethodClasses.GetRelationshipMethod).Returns("GR"); + } + } + + [TestCaseSource(nameof(Get_Method_Abbreviation__Cases))] + public string Get_Method_Abbreviation(Guid instanceGuid) + { + InstanceHandle c_Method = Oms.GetInstance(KnownInstanceGuids.Classes.Method); + + ConditionalSelectAttributeMethod sac = Oms.GetInstance(KnownInstanceGuids.Methods.ConditionalSelectAttribute.Method__get__Method_Abbreviation); + ReturnAttributeMethodBinding ramb = sac.CreateMethodBinding(Oms); + + OmsContext context = Oms.CreateContext(); + context.SetWorkData(c_Method, sac); + + InstanceHandle wd = Oms.Execute(context, ramb); + object? value = context.GetWorkData(wd); + if (value is string) + { + return (string)value; + } + return String.Empty; + } + + + + + [Test] public void Test__Get_Method_Abbreviation__SAC() {