11Class {
2- #name : # RSAlignmentTest ,
3- #superclass : # TestCase ,
2+ #name : ' RSAlignmentTest' ,
3+ #superclass : ' TestCase' ,
44 #instVars : [
55 ' align'
66 ],
7- #category : ' Roassal-Layouts-Tests'
7+ #category : ' Roassal-Layouts-Tests' ,
8+ #package : ' Roassal-Layouts-Tests'
89}
910
10- { #category : # running }
11+ { #category : ' running' }
1112RSAlignmentTest >> setUp [
1213 super setUp.
1314 align := RSAlignment new
1415]
1516
16- { #category : # tests }
17+ { #category : ' tests' }
1718RSAlignmentTest >> testCenter [
1819 | es |
1920 es := (1 to: 5 ) collect: [ :v | RSLayoutNode new size: 10 ] as: RSGroup .
@@ -23,7 +24,7 @@ RSAlignmentTest >> testCenter [
2324 self assert: es encompassingRectangle equals: ((0.0 @0.0 ) corner: (70.0 @10.0 ))
2425]
2526
26- { #category : # tests }
27+ { #category : ' tests' }
2728RSAlignmentTest >> testFromBottom [
2829 | es |
2930 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -36,7 +37,7 @@ RSAlignmentTest >> testFromBottom [
3637 self assert: (es collect: [ :e | e encompassingRectangle bottom ]) asArray equals: #(170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0)
3738]
3839
39- { #category : # tests }
40+ { #category : ' tests' }
4041RSAlignmentTest >> testFromLeft [
4142 | es |
4243 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -49,7 +50,7 @@ RSAlignmentTest >> testFromLeft [
4950 self assert: (es collect: [ :e | e encompassingRectangle left ]) asArray equals: #(-150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0)
5051]
5152
52- { #category : # tests }
53+ { #category : ' tests' }
5354RSAlignmentTest >> testFromLeftWithAFixShape [
5455 | es |
5556 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -61,7 +62,7 @@ RSAlignmentTest >> testFromLeftWithAFixShape [
6162 self assert: (es collect: [ :e | e encompassingRectangle left ]) asArray equals: #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
6263]
6364
64- { #category : # tests }
65+ { #category : ' tests' }
6566RSAlignmentTest >> testFromLeftWithFixedShape [
6667 | es c |
6768 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -79,7 +80,7 @@ RSAlignmentTest >> testFromLeftWithFixedShape [
7980 self assert: (es collect: [ :e | e encompassingRectangle left ]) asArray equals: #(-150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0 -150.0)
8081]
8182
82- { #category : # tests }
83+ { #category : ' tests' }
8384RSAlignmentTest >> testFromRight [
8485 | es |
8586 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -92,7 +93,7 @@ RSAlignmentTest >> testFromRight [
9293 self assert: (es collect: [ :e | e encompassingRectangle right ]) asArray equals: #(170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0 170.0)
9394]
9495
95- { #category : # tests }
96+ { #category : ' tests' }
9697RSAlignmentTest >> testFromTop [
9798 | es |
9899 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -105,7 +106,7 @@ RSAlignmentTest >> testFromTop [
105106 self assert: (es collect: [ :e | e encompassingRectangle top ]) asArray equals: #(-50.0 -50.0 -50.0 -50.0 -50.0 -50.0 -50.0 -50.0 -50.0 -50.0)
106107]
107108
108- { #category : # tests }
109+ { #category : ' tests' }
109110RSAlignmentTest >> testFromTopWithAFixShape [
110111 | es |
111112 es := (10 to: 100 by: 10 ) collect: [ :n | RSLayoutNode new size: n; yourself ].
@@ -120,7 +121,7 @@ RSAlignmentTest >> testFromTopWithAFixShape [
120121 self assert: (es collect: [ :e | e encompassingRectangle top ]) asArray equals: #(0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0)
121122]
122123
123- { #category : # tests }
124+ { #category : ' tests' }
124125RSAlignmentTest >> testHasElement [
125126 self deny: align hasShape.
126127 align shapes: (Array with: RSLayoutNode new ).
@@ -129,7 +130,7 @@ RSAlignmentTest >> testHasElement [
129130 self deny: align hasShape
130131]
131132
132- { #category : # tests }
133+ { #category : ' tests' }
133134RSAlignmentTest >> testNoErrorOnDefault [
134135
135136 RSAlignment new left; right; top; bottom
0 commit comments