Skip to content

implemented ConcernUsageExtensions and corresponding test#311

Closed
TanaseMariusatstarion wants to merge 6 commits into
developmentfrom
108-feature-implement-concernusageextensions
Closed

implemented ConcernUsageExtensions and corresponding test#311
TanaseMariusatstarion wants to merge 6 commits into
developmentfrom
108-feature-implement-concernusageextensions

Conversation

@TanaseMariusatstarion

Copy link
Copy Markdown
Contributor

Prerequisites

  • I have written a descriptive pull-request title
  • I have verified that there are no overlapping pull-requests open
  • I have verified that I am following the SysML2.NET code style guidelines
  • I have provided test coverage for my change (where applicable)

Description

Fixed #108 implementation of ConcernUsage extension.

antoineatstariongroup and others added 5 commits June 26, 2026 14:42
* Fix #312: enforce multiplicity on all patterns

* fix failing tests

* Targets to definition instead of type

* ternary operator for null check

* SQ issues
…geextensions' into 108-feature-implement-concernusageextensions

# Conflicts:
#	SysML2.NET.Tests/Extend/ConcernUsageExtensionsTestFixture.cs
#	SysML2.NET/Extend/ConcernUsageExtensions.cs
@sonarqubecloud

Copy link
Copy Markdown

@antoineatstariongroup antoineatstariongroup left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

General comment : It's preferable to rebase the branch to not have to review changes that are already part of the development branch

.OfType<IFeatureTyping>()
.Select(featureTyping => featureTyping.Type)
.OfType<IConcernDefinition>()
.FirstOrDefault();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation specifies "the single type", I would recommend to use .SingleOrDefault() instead of .FirstOfDefault().

return concernUsageSubject == null
? throw new ArgumentNullException(nameof(concernUsageSubject))
: concernUsageSubject.OwnedRelationship
.OfType<IFeatureTyping>()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's preferable to use the ".type" property here

@antoineatstariongroup
antoineatstariongroup deleted the 108-feature-implement-concernusageextensions branch June 29, 2026 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Implement ConcernUsageExtensions

2 participants