Skip to content

Instantly share code, notes, and snippets.

@mabdi
Created October 14, 2020 14:09
Show Gist options
  • Save mabdi/34bb70f7fd13660be46af5bcb755c497 to your computer and use it in GitHub Desktop.
Save mabdi/34bb70f7fd13660be46af5bcb755c497 to your computer and use it in GitHub Desktop.
'From Pharo8.0.0 of 22 January 2020 [Build information: Pharo-8.0.0+build.1124.sha.0932da82f08175e906b0e2a8052120c823374e9f (64 Bit)] on 14 October 2020 at 4:08:16.160034 pm'!
RSHighlightableTest subclass: #RSHighlightableTest113
instanceVariableNames: ''
classVariableNames: ''
package: 'SmallAmpFinalClasses'!
!RSHighlightableTest113 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 9/11/2020 01:02'!
testBasic_amp_N7
<smallAmpCoveres: 'RemoveCaretOperator#RSHighlightable#highlightShapes#18#34'>
<madeBySmallAmp>
| c shapes previousColor aRSHighlightable |
c := RSCanvas new.
shapes := (1 to: 10)
collect: [ :n |
RSEllipse new
size: 20;
model: n ]
as: RSGroup.
c addAll: shapes.
RSGridLayout on: shapes.
previousColor := shapes fifth color.
aRSHighlightable := RSHighlightable new.
self
should: [ aRSHighlightable doHighlight: nil ]
raise: MessageNotUnderstood! !
!RSHighlightableTest113 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 9/11/2020 01:02'!
testBasic_amp_R3
<smallAmpCoveres: 'RemoveCaretOperator#RSHighlightable#highlightShapes#18#34'>
<madeBySmallAmp>
| c shapes previousColor aRSHighlightable |
c := RSCanvas new.
shapes := (1 to: 10)
collect: [ :n |
RSEllipse new
size: 20;
model: n ]
as: RSGroup.
RSGridLayout on: shapes.
previousColor := shapes fifth color.
aRSHighlightable := RSHighlightable new.
self
should: [ aRSHighlightable doHighlight: shapes fifth ]
raise: MessageNotUnderstood! !
!RSHighlightableTest113 methodsFor: 'as yet unclassified' stamp: 'Mehrdad 9/11/2020 01:02'!
testBasic_amp_A104
"I test correctness of:
- `^ highlightShapes` in method: `RSHighlightable >> #highlightShapes`
- `^ announcer ifNil: [ announcer := Announcer new ]` in method: `RSHighlightable >> #announcer` when {#announcer->nil}
"
<smallAmpCoveres: 'RemoveCaretOperator#RSHighlightable#announcer#12#60'>
<madeBySmallAmp>
| c shapes previousColor aRSHighlightable1 aRSHighlightable2 anAnnouncer |
c := RSCanvas new.
shapes := (1 to: 10)
collect: [ :n |
RSEllipse new
size: 20;
model: n ]
as: RSGroup.
c addAll: shapes.
RSGridLayout on: shapes.
previousColor := shapes fifth color.
aRSHighlightable1 := RSHighlightable new.
self
assert:
aRSHighlightable1 highlightShapes class
equals: BlockClosure.
aRSHighlightable1 doHighlight: shapes fifth.
RSHighlightable new
record: shapes fifth
selector: #color
value: Color blue.
aRSHighlightable2 := RSHighlightable new.
anAnnouncer := aRSHighlightable2
restore: shapes fifth selector: #color;
announcer.
self assert:
anAnnouncer class equals: Announcer! !
"-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- "!
RSHighlightableTest113 class
instanceVariableNames: ''!
!RSHighlightableTest113 class methodsFor: 'as yet unclassified' stamp: 'Mehrdad 9/11/2020 01:02'!
allTestSelectors
| answer |
answer := Set withAll: self testSelectors.
answer addAll: self superclass allTestSelectors.
^ answer asSortedCollection asOrderedCollection! !
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment