Creating sunburst segment accessors, instance creation method and tests.
This commit is contained in:
parent
950da1e35e
commit
07af684d34
@ -8,7 +8,7 @@ Class {
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburst >> segments: aEcSunburstSegment [
|
||||
EcSunburst >> segments [
|
||||
|
||||
segments := aEcSunburstSegment
|
||||
^ segments ifNil: [ segments := OrderedCollection new ].
|
||||
]
|
||||
|
@ -10,24 +10,59 @@ Class {
|
||||
#category : #'EchartsPharo-EchartsPharo'
|
||||
}
|
||||
|
||||
{ #category : #'instace creation' }
|
||||
EcSunburstSegment class >> name: aName value: aNumber color: aColor children: anEcSunburstSegment [
|
||||
|
||||
^ self new
|
||||
name: aName;
|
||||
value: aNumber;
|
||||
color: aColor;
|
||||
children: anEcSunburstSegment;
|
||||
yourself
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> children [
|
||||
|
||||
^ children
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> children: anEcSunburstSegment [
|
||||
|
||||
children := anEcSunburstSegment
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> color [
|
||||
|
||||
^ color
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> color: aColor [
|
||||
|
||||
color := aColor
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> name [
|
||||
|
||||
^ name
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> name: string [
|
||||
|
||||
name := string
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> value [
|
||||
|
||||
^ value
|
||||
]
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegment >> value: number [
|
||||
|
||||
|
24
Apps/EchartsPharo/EcSunburstSegmentTest.class.st
Normal file
24
Apps/EchartsPharo/EcSunburstSegmentTest.class.st
Normal file
@ -0,0 +1,24 @@
|
||||
Class {
|
||||
#name : #EcSunburstSegmentTest,
|
||||
#superclass : #TestCase,
|
||||
#category : #'EchartsPharo-EchartsPharo'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstSegmentTest >> testSunbusrtSegmentInstanceCreation [
|
||||
|
||||
| sunburstSegment children|
|
||||
children := EcSunburstSegment new.
|
||||
sunburstSegment := EcSunburstSegment
|
||||
name: '@profile'
|
||||
value: 2
|
||||
color: Color red
|
||||
children: children.
|
||||
|
||||
self
|
||||
assert: { sunburstSegment name.
|
||||
sunburstSegment value.
|
||||
sunburstSegment color.
|
||||
sunburstSegment children }
|
||||
equals: { '@profile'. 2. Color red. children}
|
||||
]
|
14
Apps/EchartsPharo/EcSunburstTest.class.st
Normal file
14
Apps/EchartsPharo/EcSunburstTest.class.st
Normal file
@ -0,0 +1,14 @@
|
||||
Class {
|
||||
#name : #EcSunburstTest,
|
||||
#superclass : #TestCase,
|
||||
#category : #'EchartsPharo-EchartsPharo'
|
||||
}
|
||||
|
||||
{ #category : #accessing }
|
||||
EcSunburstTest >> testSegmentsIsCollection [
|
||||
|
||||
| sunburst |
|
||||
sunburst := EcSunburst new.
|
||||
self assert: sunburst segments equals: OrderedCollection new
|
||||
|
||||
]
|
Loading…
Reference in New Issue
Block a user