From dfa2bd440a20c695fdc8b7f244fe21590506cd8d Mon Sep 17 00:00:00 2001 From: Marcel Vielhaus Date: Thu, 21 Nov 2024 14:27:44 +0100 Subject: [PATCH] Port: Fix exception on creating a bidirectional link to a new resource to release 8 --- .../Mocks/ReferenceResource.cs | 2 +- .../Moryx.Resources.Management.Tests/ResourceLinkerTests.cs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Tests/Moryx.Resources.Management.Tests/Mocks/ReferenceResource.cs b/src/Tests/Moryx.Resources.Management.Tests/Mocks/ReferenceResource.cs index 50e0dc9c..8ce46163 100644 --- a/src/Tests/Moryx.Resources.Management.Tests/Mocks/ReferenceResource.cs +++ b/src/Tests/Moryx.Resources.Management.Tests/Mocks/ReferenceResource.cs @@ -111,7 +111,7 @@ public void SetMany(IReadOnlyList references) public event EventHandler SomeChanged; } - public class BidirectionalReferenceResource : PublicResource + public class BidirectionalReferenceResource : Resource { [ResourceReference(ResourceRelationType.Extension, ResourceReferenceRole.Source, nameof(SourceReference))] public ReferenceResource SourceReference { get; set; } diff --git a/src/Tests/Moryx.Resources.Management.Tests/ResourceLinkerTests.cs b/src/Tests/Moryx.Resources.Management.Tests/ResourceLinkerTests.cs index 2a0e580c..c068bf9e 100644 --- a/src/Tests/Moryx.Resources.Management.Tests/ResourceLinkerTests.cs +++ b/src/Tests/Moryx.Resources.Management.Tests/ResourceLinkerTests.cs @@ -141,9 +141,9 @@ public void SaveBidirectionalReferences() var newCollectionResource = new SimpleResource() { Name = "newCollectionResource" }; ResourceReferenceTools.InitializeCollections(newCollectionResource); // Fill graph - _graph[1] = new ResourceWrapper(instance); - _graph[2] = new ResourceWrapper(resource); - _graph[3] = new ResourceWrapper(collectionResource); + _graph[1] = instance; + _graph[2] = resource; + _graph[3] = collectionResource; // Set single references instance.TargetReference = resource; // The bidirectional reference is created with an existing resource instance.NewTargetReference = newResource; // The bidirectional reference is created with a new resource