-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2b1df9
commit 508962f
Showing
2 changed files
with
150 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
Class { | ||
#name : #SKExecuteControlsTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'environment', | ||
'controls' | ||
], | ||
#category : #'SqueakKara-Tests' | ||
} | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:34' | ||
} | ||
SKExecuteControlsTest >> setUp [ | ||
|
||
environment := (SKEnvironment newWithKaraAt: 1 @ 1). | ||
controls := environment executeControls. | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:45' | ||
} | ||
SKExecuteControlsTest >> tearDown [ | ||
|
||
environment close | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:47' | ||
} | ||
SKExecuteControlsTest >> testRun [ | ||
|
||
environment workspace userCode: 'kara move'. | ||
controls actionRun. | ||
environment executer step. | ||
self assert: environment kara coordinates = (2 @ 1) | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:50' | ||
} | ||
SKExecuteControlsTest >> testRunPause [ | ||
|
||
environment workspace userCode: 'kara move. kara move. kara move'. | ||
controls actionRun. | ||
environment executer step. | ||
controls actionRun. | ||
self assert: environment kara coordinates = (2 @ 1) | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:42' | ||
} | ||
SKExecuteControlsTest >> testSlider [ | ||
|
||
controls sliderSpeedValueChanged: 10. | ||
self assert: environment executer speed = 10. | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:51' | ||
} | ||
SKExecuteControlsTest >> testStop [ | ||
|
||
environment workspace userCode: 'kara move.'. | ||
controls actionRun. | ||
controls actionStop. | ||
self assert: environment executer state = #terminated. | ||
] |
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,75 @@ | ||
Class { | ||
#name : #SKExecuteControlsTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'environment', | ||
'controls' | ||
], | ||
#category : #'SqueakKara-Tests' | ||
} | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:34' | ||
} | ||
SKExecuteControlsTest >> setUp [ | ||
|
||
environment := (SKEnvironment newWithKaraAt: 1 @ 1). | ||
controls := environment executeControls. | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:45' | ||
} | ||
SKExecuteControlsTest >> tearDown [ | ||
|
||
environment close | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:47' | ||
} | ||
SKExecuteControlsTest >> testRun [ | ||
|
||
environment workspace userCode: 'kara move'. | ||
controls actionRun. | ||
environment executer step. | ||
self assert: environment kara coordinates = (2 @ 1) | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:50' | ||
} | ||
SKExecuteControlsTest >> testRunPause [ | ||
|
||
environment workspace userCode: 'kara move. kara move. kara move'. | ||
controls actionRun. | ||
environment executer step. | ||
controls actionRun. | ||
self assert: environment kara coordinates = (2 @ 1) | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:42' | ||
} | ||
SKExecuteControlsTest >> testSlider [ | ||
|
||
controls sliderSpeedValueChanged: 10. | ||
self assert: environment executer speed = 10. | ||
] | ||
|
||
{ | ||
#category : #'as yet unclassified', | ||
#'squeak_changestamp' : 'EB 7/12/2024 11:51' | ||
} | ||
SKExecuteControlsTest >> testStop [ | ||
|
||
environment workspace userCode: 'kara move.'. | ||
controls actionRun. | ||
controls actionStop. | ||
self assert: environment executer state = #terminated. | ||
] |