From c440e42a160806df2a79ed3c53725fd751a56ccf Mon Sep 17 00:00:00 2001 From: Olesya Bauer Date: Sun, 29 May 2022 17:49:09 +0200 Subject: [PATCH] Two working tests, one almost working --- .../methodProperties.json | 2 +- .../instance/endMargin.st | 4 +++ .../instance/moveMovingLine..st | 12 +++++++++ .../instance/startMargin.st | 4 +++ .../instance/testMovingLineInRightPosition.st | 26 ++++++++++++++----- ...estMovingLineInitializedInRightPosition.st | 12 +++++++++ .../testMovingLineStoppedAtEndMargin.st | 14 ++++++++++ .../methodProperties.json | 7 ++++- 8 files changed, 72 insertions(+), 9 deletions(-) create mode 100644 packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/endMargin.st create mode 100644 packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/moveMovingLine..st create mode 100644 packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/startMargin.st create mode 100644 packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInitializedInRightPosition.st create mode 100644 packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineStoppedAtEndMargin.st diff --git a/packages/AnimationsEditor-Core.package/AnimationsEditorMovingLine.class/methodProperties.json b/packages/AnimationsEditor-Core.package/AnimationsEditorMovingLine.class/methodProperties.json index ea72e0e..8976ac3 100644 --- a/packages/AnimationsEditor-Core.package/AnimationsEditorMovingLine.class/methodProperties.json +++ b/packages/AnimationsEditor-Core.package/AnimationsEditorMovingLine.class/methodProperties.json @@ -7,5 +7,5 @@ "lineWidth" : "SG 5/23/2022 18:47", "movingLine" : "SG 5/23/2022 18:48", "movingLine:" : "SG 5/23/2022 18:48", - "step" : "ob 5/27/2022 15:41", + "step" : "ob 5/29/2022 17:26", "stepTime" : "SG 5/23/2022 18:37" } } diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/endMargin.st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/endMargin.st new file mode 100644 index 0000000..1484d4d --- /dev/null +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/endMargin.st @@ -0,0 +1,4 @@ +accessing +endMargin + + ^25. \ No newline at end of file diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/moveMovingLine..st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/moveMovingLine..st new file mode 100644 index 0000000..e1f2de1 --- /dev/null +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/moveMovingLine..st @@ -0,0 +1,12 @@ +calculation +moveMovingLine: aLine + |duration offset endPositionX| + endPositionX := self timeline width - 25. + "duration := (self timeline endTime - self timeline startTime)/100. --> richtige Zeit" + (aLine x >= endPositionX) ifTrue: [aLine position: endPositionX @ (aLine position y)"self abandon"] + ifFalse: + [ + + duration := (self timeline endTime - self timeline startTime)/100. + offset := (self timeline width - 105- 25) / duration. + aLine position: aLine position + (offset@0).] \ No newline at end of file diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/startMargin.st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/startMargin.st new file mode 100644 index 0000000..77e7dd3 --- /dev/null +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/startMargin.st @@ -0,0 +1,4 @@ +accessing +startMargin + + ^105. \ No newline at end of file diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInRightPosition.st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInRightPosition.st index acd9ce6..a078ecd 100644 --- a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInRightPosition.st +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInRightPosition.st @@ -1,6 +1,6 @@ testing testMovingLineInRightPosition -| positionProperty delay| +| positionProperty d| positionProperty := (self animationsEditorInstance propertyList at: 2) subproperties at: 'position'. self animationsEditorInstance selectedTreeNode: positionProperty. positionProperty @@ -9,11 +9,23 @@ positionProperty := (self animationsEditorInstance propertyList at: 2) subproper frame: 1000; addKeyframe. - self animationsEditorInstance playAnimations. - self movingLine: self timeline movingLine. + "self animationsEditorInstance playAnimations." + "self timeline createMovingLine." + d:= Morph new extent: 3@100; + color: Color black; + position: 105@25. + 1000 timesRepeat: [self moveMovingLine: d]. + Transcript show: d position x. + d comeToFront. "delay := Delay forMilliseconds: 500." - Delay forMilliseconds: 500. - self movingLine: self timeline movingLine. - self movingLine stopStepping. + "Delay forMilliseconds: 500. " + + "self movingLine stopStepping. " + + self assert: (d position) = ((self timeline width - 25)@ self timeline trackHeight). + + + - self assert: (self movingLine position x) = ((self timeline width - 150)/2+125). \ No newline at end of file + + diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInitializedInRightPosition.st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInitializedInRightPosition.st new file mode 100644 index 0000000..3909143 --- /dev/null +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineInitializedInRightPosition.st @@ -0,0 +1,12 @@ +testing +testMovingLineInitializedInRightPosition + + self timeline createMovingLine. + self movingLine: self timeline movingLine. + self assert: (self movingLine position ) = (self movingLine startMargin @ self timeline trackHeight). + + + + + + diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineStoppedAtEndMargin.st b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineStoppedAtEndMargin.st new file mode 100644 index 0000000..5cf5fc3 --- /dev/null +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/instance/testMovingLineStoppedAtEndMargin.st @@ -0,0 +1,14 @@ +testing +testMovingLineStoppedAtEndMargin +|movingLine| + movingLine:= Morph new extent: 3@100; + color: Color black; + position: self startMargin @self timeline trackHeight. + 1000 timesRepeat: [self moveMovingLine: movingLine]. + self assert: (movingLine position) = ((self timeline width - self endMargin)@ self timeline trackHeight). + + + + + + diff --git a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/methodProperties.json b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/methodProperties.json index a3f58af..1a7cecb 100644 --- a/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/methodProperties.json +++ b/packages/AnimationsEditor-Tests.package/AnimationsEditorTimelineTest.class/methodProperties.json @@ -8,10 +8,12 @@ "calculateKeyframeCenterOn:" : "NB 8/1/2021 14:07", "createKeyframeWith:on:" : "NB 8/1/2021 14:21", "endFrame" : "MH 8/1/2021 18:42", + "endMargin" : "ob 5/29/2022 17:48", "frameNumber100" : "NB 8/1/2021 14:52", "keyframeHeightOn:" : "NB 8/1/2021 14:07", "keyframeWidthOn:" : "NB 8/1/2021 14:07", "middleOfAnimationTime" : "NB 8/1/2021 16:09", + "moveMovingLine:" : "ob 5/29/2022 17:43", "movingLine" : "ob 5/27/2022 16:57", "movingLine:" : "ob 5/27/2022 16:57", "paddingDistance" : "NB 8/1/2021 16:04", @@ -21,10 +23,13 @@ "secondLastOn:" : "NB 8/1/2021 12:16", "setUp" : "ob 5/27/2022 17:02", "startFrame" : "MH 8/1/2021 18:42", + "startMargin" : "ob 5/29/2022 17:46", "tearDown" : "NB 8/1/2021 12:38", "testAddKeyframeToRightPosition" : "NB 8/1/2021 15:22", "testDistanceBetweenKeyframes" : "mjs 8/1/2021 16:45", - "testMovingLineInRightPosition" : "ob 5/27/2022 17:16", + "testMovingLineInRightPosition" : "ob 5/29/2022 17:40", + "testMovingLineInitializedInRightPosition" : "ob 5/29/2022 17:34", + "testMovingLineStoppedAtEndMargin" : "ob 5/29/2022 17:48", "timeline" : "MH 8/1/2021 18:43", "timeline:" : "MH 8/1/2021 18:43", "wait:" : "ob 5/27/2022 16:59",