Skip to content

Commit

Permalink
finished testing and last changes in Core Package
Browse files Browse the repository at this point in the history
  • Loading branch information
nick-bessin committed May 21, 2021
1 parent 6f76170 commit 2bbe667
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveJson
outputFileDirectory
^ UIManager default saveFilenameRequest: 'Please, enter file name.' initialAnswer: 'test'.
^ UIManager default saveFilenameRequest: 'Please, enter file name.' initialAnswer: 'animation'.


Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ saveToJson: aTreeNode

jsonStructure := self createStructure: self propertyStartEnd startTime with: self propertyStartEnd endTime.
jsonStructure := self addMorphToJson: jsonStructure with: aTreeNode.

jsonString := self dictionaryToJson: jsonStructure.

self writeJsonToFile: jsonString with: self outputFileDirectory.

Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
saveJson
writeJsonToFile: aJsonString with: aDirectory
| outputStream |
aDirectory
ifNotNil: [
outputStream := StandardFileStream newFileNamed: aDirectory, '.json'.
aJsonString storeOn: outputStream
]


FileDirectory default forceNewFileNamed: aDirectory, '.json' do: [:stream |
stream nextPutAll: aJsonString].
]
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"insertMorph:Into:" : "JIZ 6/3/2020 16:56",
"mainWindow" : "JIZ 6/3/2020 17:04",
"mainWindow:" : "JIZ 6/3/2020 17:04",
"outputFileDirectory" : "MH 5/15/2021 10:46",
"outputFileDirectory" : "NB 5/21/2021 09:07",
"playAnimations" : "MH 5/10/2021 11:48",
"propertyEditorPanel" : "DM 6/22/2020 01:27",
"propertyEditorPanel:" : "DM 6/12/2020 20:41",
Expand All @@ -63,7 +63,7 @@
"propertyTreeMorph:" : "DM 6/18/2020 08:59",
"resetTargetMorph" : "DM 8/5/2020 20:05",
"saveAnimations" : "NB 5/13/2021 09:35",
"saveToJson:" : "MH 5/15/2021 10:49",
"saveToJson:" : "NB 5/21/2021 09:05",
"seedProperties" : "DM 8/5/2020 19:54",
"selectMorphByHand" : "DM 8/5/2020 20:07",
"selectedTreeNode" : "JIZ 5/27/2020 15:31",
Expand All @@ -75,4 +75,4 @@
"updateInformationText:" : "DM 8/4/2020 16:18",
"windowReference" : "DM 8/4/2020 13:19",
"windowReference:" : "DM 8/4/2020 13:19",
"writeJsonToFile:with:" : "NB 5/15/2021 11:40" } }
"writeJsonToFile:with:" : "NB 5/21/2021 08:39" } }
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ saveJson
testAddFrameForColor
| aDictionary aProperty |

aDictionary := ((self animationsEditorInstance addFrame: self colorTreeNode) at: self colorTreeNode title asSymbol) value.
aDictionary := self animationsEditorInstance addFrame: self colorTreeNode.
self halt.
aProperty := (aDictionary at: #properties) first.

self assert: (aProperty at: #name) equals: 'color'.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
saveJson
testWriteJsonToFile
| jsonString |
| jsonString fileContent |

jsonString := '{ "Test": { "id": "1"} }'.
self animationsEditorInstance writeJsonToFile: jsonString with: 'test'.
self assert: false.
"read json using STON reader and compare. Delete Test file"
fileContent := (FileStream fileNamed: 'test.json') contents.
self assert: fileContent isEmpty not.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"startInformationDictionary:" : "MH 5/20/2021 11:22",
"tearDown" : "MH 5/17/2021 11:08",
"testAddColorFrame" : "MH 5/20/2021 11:15",
"testAddFrameForColor" : "MH 5/20/2021 11:52",
"testAddFrameForColor" : "NB 5/21/2021 08:46",
"testAddMorphToJson" : "MH 5/20/2021 11:56",
"testAddPositionFrame" : "MH 5/20/2021 11:16",
"testAddRotationFrame" : "MH 5/20/2021 11:18",
Expand All @@ -37,4 +37,4 @@
"testTreeSpecWithNoMorph" : "DM 8/7/2020 18:59",
"testTreeSpecWithOneMorph" : "DM 8/7/2020 18:59",
"testTreeSpecWithOneMorphPosition" : "DM 8/4/2020 13:31",
"testWriteJsonToFile" : "MH 5/15/2021 11:23" } }
"testWriteJsonToFile" : "NB 5/21/2021 09:08" } }

0 comments on commit 2bbe667

Please sign in to comment.