/
ClyInstallMetaLinkPresenterTest.class.st
86 lines (76 loc) · 2.83 KB
/
ClyInstallMetaLinkPresenterTest.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
Class {
#name : #ClyInstallMetaLinkPresenterTest,
#superclass : #TestCase,
#instVars : [
'presenter',
'node',
'metalink',
'metalink2',
'breakpoint',
'executionCounter',
'watchpoint'
],
#category : #'Calypso-SystemPlugins-Reflectivity-Browser-Tests-Metalinks'
}
{ #category : #running }
ClyInstallMetaLinkPresenterTest >> presenterForMetalinkInstallation [
^ClyMetaLinkInstallationPresenter onNode: node forInstallation: true
]
{ #category : #running }
ClyInstallMetaLinkPresenterTest >> presenterForMetalinkUninstallation [
^ ClyMetaLinkInstallationPresenter onNode: node forInstallation: false
]
{ #category : #running }
ClyInstallMetaLinkPresenterTest >> setUp [
"Hooks that subclasses may override to define the fixture of test."
MetaLink uninstallAll.
node := RBTemporaryNode named: 'test'.
node propertyAt: #links put: OrderedCollection new.
metalink := MetaLink new.
metalink2 := MetaLink new.
breakpoint := MetaLink new metaObject: Break; yourself.
executionCounter := MetaLink new metaObject: ExecutionCounter new; yourself.
watchpoint := MetaLink new metaObject: Watchpoint new; yourself.
node links add: metalink.
node links add: breakpoint.
node links add: executionCounter.
node links add: watchpoint
]
{ #category : #running }
ClyInstallMetaLinkPresenterTest >> tearDown [
MetaLink uninstallAll
]
{ #category : #tests }
ClyInstallMetaLinkPresenterTest >> testRelevantMetalinksForInstallation [
|links|
links := self presenterForMetalinkInstallation allRelevantMetaLinks.
self assert: links size >= 2.
self assertCollection: links includesAll: { metalink. metalink2 }.
self denyCollection: links includesAll: { breakpoint. watchpoint. executionCounter }.
]
{ #category : #tests }
ClyInstallMetaLinkPresenterTest >> testRelevantMetalinksForUninstallation [
| links |
links := self presenterForMetalinkUninstallation allRelevantMetaLinks.
self assert: links size equals: 1.
self assertCollection: links hasSameElements: { metalink }
]
{ #category : #tests }
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsCollectionSize [
self assert: self presenterForMetalinkInstallation toolbarButtons size equals: 2.
self assert: self presenterForMetalinkUninstallation toolbarButtons size equals: 2.
]
{ #category : #tests }
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsForMetalinkInstallation [
|toolbarButtons|
toolbarButtons := self presenterForMetalinkInstallation toolbarButtons.
self assert: toolbarButtons first label equals: 'Install'.
self assert: toolbarButtons last label equals: 'Cancel'.
]
{ #category : #tests }
ClyInstallMetaLinkPresenterTest >> testToolbarButtonsForMetalinkUninstallation [
|toolbarButtons|
toolbarButtons := self presenterForMetalinkUninstallation toolbarButtons.
self assert: toolbarButtons first label equals: 'Uninstall'.
self assert: toolbarButtons last label equals: 'Cancel'.
]