Skip to content

Commit

Permalink
correcting tests in FASTCopyVisitorCodeGeneratorTest (+ removed tearD…
Browse files Browse the repository at this point in the history
…own)
  • Loading branch information
anquetil committed Nov 10, 2024
1 parent d2c1b8c commit 06024e5
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/FAST-Core-Tools-Tests/FASTCopyVisitorCodeGeneratorTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,15 @@ FASTCopyVisitorCodeGeneratorTest >> setUp [
visitorMethods add: method -> category ]
]

{ #category : 'running' }
FASTCopyVisitorCodeGeneratorTest >> tearDown [
super tearDown.

self class package extensionMethods do: #removeFromSystem
]

{ #category : 'tests' }
FASTCopyVisitorCodeGeneratorTest >> testGenerateCopyMethod [

generator rootClass: FmxTraitsTestGenerateAccessorBEntity visitorClass: visitorClass.

self assertGeneratedMethod: [ :methodCode |
methodCode beginsWith: 'copy: ' ]
[ self assertGeneratedMethod: [ :methodCode |
methodCode beginsWith: 'copy: ' ]
]
ensure: [ self class package extensionMethods do: #removeFromSystem ]
]

{ #category : 'tests' }
Expand Down Expand Up @@ -98,10 +93,13 @@ FASTCopyVisitorCodeGeneratorTest >> testShouldNotCopyMultivaluedDerivedProperty
property := FmxTraitsTestGenerateAccessorBClassB asMooseDescription
allProperties detect: [ :prop | prop name = 'relationToA' ].

"focing it to be multivalued"
"forcing it to be multivalued"
property isMultivalued: true.
self assert: property isMultivalued.
self deny: (generator shouldCopyProperty: property)
[
self assert: property isMultivalued.
self deny: (generator shouldCopyProperty: property)
]
ensure: [ property isMultivalued: false ]
]

{ #category : 'tests' }
Expand All @@ -114,6 +112,8 @@ FASTCopyVisitorCodeGeneratorTest >> testShouldNotCopyPropertyParent [

"forcing it to be to parent"
property isContainer: true.
self assert: property isContainer.
self deny: (generator shouldCopyProperty: property)
[ self assert: property isContainer.
self deny: (generator shouldCopyProperty: property)
]
ensure: [ property isContainer: false ]
]

0 comments on commit 06024e5

Please sign in to comment.