Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests for issue #577 #803

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions src/Famix-Test10-Tests/FamixTest10Test.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
Class {
#name : #FamixTest10Test,
#superclass : #TestCase,
#category : #'Famix-Test10-Tests'
}

{ #category : #running }
FamixTest10Test >> tearDown [

FamixTest10Generator packageName asPackageIfAbsent: [
^ super tearDown ].
FamixTest10Generator deleteMetaModel.
super tearDown
]

{ #category : #tests }
FamixTest10Test >> testRegenerationWithSlightDifferenceFromScratchWorks [

FamixTest10Generator generate.
FamixTest10Generator deleteMetaModel.

FamixTest10BisGenerator generate.

"Explicitly check that the default value is true"
self
assert:
((self class environment at: #FamixTest10MyClass) slotNamed:
#isTasty) defaultValue
equals: true
]

{ #category : #tests }
FamixTest10Test >> testRegenerationWithSlightDifferenceRedefinesSlotDefaultValue [

FamixTest10Generator generate.
FamixTest10BisGenerator generate.

"Explicitly check that the default value is true"
self
assert:
((self class environment at: #FamixTest10MyClass) slotNamed:
#isTasty) defaultValue
equals: true
]
1 change: 1 addition & 0 deletions src/Famix-Test10-Tests/package.st
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Package { #name : #'Famix-Test10-Tests' }
11 changes: 11 additions & 0 deletions src/Famix-TestGenerators/FamixTest10BisGenerator.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
Class {
#name : #FamixTest10BisGenerator,
#superclass : #FamixTest10Generator,
#category : #'Famix-TestGenerators'
}

{ #category : #definition }
FamixTest10BisGenerator >> defineRelations [

myClass property: #isTasty type: #Boolean defaultValue: true
]
45 changes: 45 additions & 0 deletions src/Famix-TestGenerators/FamixTest10Generator.class.st
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
Class {
#name : #FamixTest10Generator,
#superclass : #FamixBasicInfrastructureGenerator,
#instVars : [
'myClass'
],
#category : #'Famix-TestGenerators'
}

{ #category : #accessing }
FamixTest10Generator class >> packageName [

^ #'Famix-Test10-Entities'
]

{ #category : #accessing }
FamixTest10Generator class >> prefix [

^ #'FamixTest10'
]

{ #category : #testing }
FamixTest10Generator class >> shouldBeUpToDateInLatestMoose [

"This generator is used dynamically by the tests"
^ false
]

{ #category : #definition }
FamixTest10Generator >> defineClasses [

myClass := self builder newClassNamed: #MyClass
]

{ #category : #definition }
FamixTest10Generator >> defineHierarchy [

"Do nothing"
]

{ #category : #definition }
FamixTest10Generator >> defineRelations [

myClass property: #isTasty type: #Boolean
]