Skip to content

Commit

Permalink
Merge pull request #80 from moosetechnology/visitor-code-generator
Browse files Browse the repository at this point in the history
correcting tests in FASTCopyVisitorCodeGeneratorTest (+ removed tearDown)
  • Loading branch information
NicolasAnquetil authored Nov 10, 2024
2 parents d2c1b8c + 06024e5 commit a4b7614
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 a4b7614

Please sign in to comment.