Skip to content

Commit

Permalink
Improve testAllTaggedEntities using complex model
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabriel-Darbord committed Aug 30, 2024
1 parent b979822 commit 40451ce
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/Famix-Tagging-Tests/FamixTagMooseModelTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,25 @@ FamixTagMooseModelTest >> testAllTagAssociations [

{ #category : #tests }
FamixTagMooseModelTest >> testAllTaggedEntities [
self assert: (model allTaggedEntities size) equals: 1.
self assertCollection: (model allTaggedEntities ) hasSameElements: {model entityNamed: 'Package1::Class1'}

self
assertCollection: model allTaggedEntities
hasSameElements: { (model entityNamed: 'Package1::Class1') }.

"more complex model with multiple tags at different levels"
model := FamixTagMockModelBuilder buildComplexModel.

"on a model"
self
assertCollection: model allTaggedEntities
hasSameElements: (model select: [ :entity | entity isTagged ]).

"on an entity"
self
assertCollection: (model entityNamed: 'Foo') allTaggedEntities
hasSameElements: {
(model entityNamed: 'Foo').
(model entityNamed: 'data') }
]

{ #category : #tests }
Expand Down

0 comments on commit 40451ce

Please sign in to comment.