-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added more tests
- Loading branch information
Max Hoffmann
committed
May 20, 2021
1 parent
b477da0
commit 6f76170
Showing
20 changed files
with
184 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
...nimationsEditor-Tests.package/AnimationsEditorTest.class/instance/colorFrameDictionary.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
saveJson | ||
colorFrameDictionary | ||
|
||
^ Dictionary | ||
with: #frame->500 | ||
with: #properties->{ | ||
Dictionary | ||
with: #name->'color' | ||
with: #value-> #(1.0 0.0 0.0). | ||
}. |
15 changes: 15 additions & 0 deletions
15
packages/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/colorTreeNode.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
saveJson | ||
colorTreeNode | ||
| aTreeNode animationsEditorProperty | | ||
|
||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyColor new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph color: Color red. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetColor: 'red'. | ||
|
||
^ aTreeNode. |
12 changes: 12 additions & 0 deletions
12
...ationsEditor-Tests.package/AnimationsEditorTest.class/instance/positionFrameDictionary.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
saveJson | ||
positionFrameDictionary | ||
^ Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'positionX' | ||
with: #value -> 100. | ||
Dictionary | ||
with: #name -> 'positionY' | ||
with: #value -> 200. | ||
}. |
16 changes: 16 additions & 0 deletions
16
...es/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/positionTreeNode.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
saveJson | ||
positionTreeNode | ||
| aTreeNode animationsEditorProperty | | ||
|
||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyPosition new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph position: 100 @ 200. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetPosition: 100 @ 200. | ||
|
||
^ aTreeNode. | ||
|
9 changes: 9 additions & 0 deletions
9
...ationsEditor-Tests.package/AnimationsEditorTest.class/instance/rotationFrameDictionary.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
saveJson | ||
rotationFrameDictionary | ||
^ Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'rotation' | ||
with: #value -> 70. | ||
}. |
15 changes: 15 additions & 0 deletions
15
...es/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/rotationTreeNode.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
saveJson | ||
rotationTreeNode | ||
| aTreeNode animationsEditorProperty | | ||
|
||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyRotation new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph rotationDegrees: 70. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetRotation: 70. | ||
|
||
^ aTreeNode. |
12 changes: 12 additions & 0 deletions
12
...AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/sizeFrameDictionary.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
saveJson | ||
sizeFrameDictionary | ||
^ Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'width' | ||
with: #value -> 100. | ||
Dictionary | ||
with: #name -> 'height' | ||
with: #value -> 200. | ||
}. |
15 changes: 15 additions & 0 deletions
15
packages/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/sizeTreeNode.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
saveJson | ||
sizeTreeNode | ||
| aTreeNode animationsEditorProperty | | ||
|
||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertySize new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph extent: 100 @ 200. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetSize: 100 @ 200. | ||
|
||
^ aTreeNode. |
25 changes: 25 additions & 0 deletions
25
...nsEditor-Tests.package/AnimationsEditorTest.class/instance/startInformationDictionary..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
saveJson | ||
startInformationDictionary: aMorph | ||
^ Dictionary | ||
with: #type -> 'Morph' | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'rotation' | ||
with: #value -> aMorph rotationDegrees. | ||
Dictionary | ||
with: #name -> 'positionX' | ||
with: #value -> aMorph x. | ||
Dictionary | ||
with: #name -> 'positionY' | ||
with: #value -> aMorph y. | ||
Dictionary | ||
with: #name -> 'width' | ||
with: #value -> aMorph width. | ||
Dictionary | ||
with: #name -> 'height' | ||
with: #value -> aMorph height. | ||
Dictionary | ||
with: #name -> 'color' | ||
with: #value -> aMorph color rgbTriplet. | ||
}. | ||
|
24 changes: 3 additions & 21 deletions
24
...s/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddColorFrame.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
saveJson | ||
testAddColorFrame | ||
| jsonFrame aTreeNode animationsEditorProperty testFrame | | ||
|
||
"still need to extract instantiation of the TreeNode" | ||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyColor new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph color: Color red. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetColor: 'red'. | ||
| jsonFrame aTreeNode testFrame | | ||
|
||
aTreeNode := self colorTreeNode. | ||
jsonFrame := self animationsEditorInstance addColorFrame: aTreeNode. | ||
self halt. | ||
"also extract instantiation of testFrame" | ||
testFrame := Dictionary | ||
with: #frame->500 | ||
with: #properties->{ | ||
Dictionary | ||
with: #name->'color' | ||
with: #value-> #(1.0 0.0 0.0). | ||
}. | ||
testFrame := self colorFrameDictionary. | ||
|
||
self assert: jsonFrame equals: testFrame. |
9 changes: 9 additions & 0 deletions
9
...nimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddFrameForColor.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
saveJson | ||
testAddFrameForColor | ||
| aDictionary aProperty | | ||
|
||
aDictionary := ((self animationsEditorInstance addFrame: self colorTreeNode) at: self colorTreeNode title asSymbol) value. | ||
aProperty := (aDictionary at: #properties) first. | ||
|
||
self assert: (aProperty at: #name) equals: 'color'. | ||
|
12 changes: 12 additions & 0 deletions
12
.../AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddMorphToJson.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
saveJson | ||
testAddMorphToJson | ||
| aJsonStructure aDictionary anEntry | | ||
|
||
aDictionary := Dictionary | ||
with: #morphs -> {}. | ||
aJsonStructure := self animationsEditorInstance addMorphToJson: aDictionary with: self colorTreeNode. | ||
anEntry := (aJsonStructure at: #morphs) first. | ||
|
||
self assert: (aJsonStructure at: #morphs) size > 0. | ||
self assert: (anEntry at: #properties) size > 0. | ||
|
27 changes: 3 additions & 24 deletions
27
...nimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddPositionFrame.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
saveJson | ||
testAddPositionFrame | ||
| jsonFrame aTreeNode animationsEditorProperty testFrame | | ||
|
||
"still need to extract instantiation of the TreeNode" | ||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyPosition new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph position: 100 @ 200. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetPosition: 100 @ 200. | ||
| jsonFrame aTreeNode testFrame | | ||
|
||
aTreeNode := self positionTreeNode. | ||
jsonFrame := self animationsEditorInstance addPositionFrame: aTreeNode. | ||
|
||
"also extract instantiation of testFrame" | ||
testFrame := Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'positionX' | ||
with: #value -> 100. | ||
Dictionary | ||
with: #name -> 'positionY' | ||
with: #value -> 200. | ||
}. | ||
testFrame := self positionFrameDictionary. | ||
|
||
self assert: jsonFrame equals: testFrame. |
24 changes: 3 additions & 21 deletions
24
...nimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddRotationFrame.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,9 @@ | ||
saveJson | ||
testAddRotationFrame | ||
| jsonFrame aTreeNode animationsEditorProperty testFrame | | ||
|
||
"still need to extract instantiation of the TreeNode" | ||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertyRotation new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph rotationDegrees: 70. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetRotation: 70. | ||
| jsonFrame aTreeNode testFrame | | ||
|
||
aTreeNode := self rotationTreeNode. | ||
jsonFrame := self animationsEditorInstance addRotationFrame: aTreeNode. | ||
|
||
"also extract instantiation of testFrame" | ||
testFrame := Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'rotation' | ||
with: #value -> 70. | ||
}. | ||
testFrame := self rotationFrameDictionary. | ||
|
||
self assert: jsonFrame equals: testFrame. |
27 changes: 3 additions & 24 deletions
27
...es/AnimationsEditor-Tests.package/AnimationsEditorTest.class/instance/testAddSizeFrame.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
saveJson | ||
testAddSizeFrame | ||
| jsonFrame aTreeNode animationsEditorProperty testFrame | | ||
|
||
"still need to extract instantiation of the TreeNode" | ||
animationsEditorProperty := self animationsEditorInstance propertyList at: 2. | ||
aTreeNode := AnimationsEditorPropertySize new. | ||
aTreeNode | ||
copyOfTargetMorph: animationsEditorProperty targetMorph; | ||
targetMorph: aTreeNode copyOfTargetMorph copy. | ||
aTreeNode targetMorph extent: 100 @ 200. | ||
aTreeNode | ||
targetDuration: animationsEditorProperty defaultTargetDuration; | ||
targetSize: 100 @ 200. | ||
| jsonFrame aTreeNode testFrame | | ||
|
||
aTreeNode := self sizeTreeNode. | ||
jsonFrame := self animationsEditorInstance addSizeFrame: aTreeNode. | ||
|
||
"also extract instantiation of testFrame" | ||
testFrame := Dictionary | ||
with: #frame -> 500 | ||
with: #properties -> { | ||
Dictionary | ||
with: #name -> 'width' | ||
with: #value -> 100. | ||
Dictionary | ||
with: #name -> 'height' | ||
with: #value -> 200. | ||
}. | ||
testFrame := self sizeFrameDictionary. | ||
|
||
self assert: jsonFrame equals: testFrame. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ testDictionaryToJson | |
|
||
json := Dictionary | ||
with: #Test -> 100. | ||
|
||
jsonString := '{ | ||
"Test" : 100 | ||
}'. | ||
|
Oops, something went wrong.