-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add a way to send a notification to the user through a visualiz…
…ation
- Loading branch information
Showing
33 changed files
with
1,606 additions
and
1,611 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
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
16 changes: 8 additions & 8 deletions
16
src/Telescope-Core-Tests/ManifestTelescopeCoreTests.class.st
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
" | ||
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser | ||
" | ||
Class { | ||
#name : #ManifestTelescopeCoreTests, | ||
#superclass : #PackageManifest, | ||
#category : #'Telescope-Core-Tests-Manifest' | ||
} | ||
" | ||
I store metadata for this package. These meta data are used by other tools such as the SmalllintManifestChecker and the critics Browser | ||
" | ||
Class { | ||
#name : #ManifestTelescopeCoreTests, | ||
#superclass : #PackageManifest, | ||
#category : #'Telescope-Core-Tests-Manifest' | ||
} |
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 |
---|---|---|
@@ -1,28 +1,28 @@ | ||
Class { | ||
#name : #TLAbstractNodeTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'node' | ||
], | ||
#category : #'Telescope-Core-Tests-Model' | ||
} | ||
|
||
{ #category : #running } | ||
TLAbstractNodeTest >> setUp [ | ||
super setUp. | ||
node := TLAbstractNode new | ||
] | ||
|
||
{ #category : #tests } | ||
TLAbstractNodeTest >> testNotDuplicateAdjacentNodes [ | ||
| in inOut out adjacents | | ||
in:= TLAbstractNode withEntity: 'in'. | ||
inOut:= TLAbstractNode withEntity: 'inOut'. | ||
out:= TLAbstractNode withEntity: 'out'. | ||
TLConnection from: in to: node visualization: nil. | ||
TLConnection from: inOut to: node visualization: nil. | ||
TLConnection from: node to: inOut visualization: nil. | ||
TLConnection from: node to: out visualization: nil. | ||
adjacents:= node adjacentNodes. | ||
self assert: adjacents size equals: 3 | ||
] | ||
Class { | ||
#name : #TLAbstractNodeTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'node' | ||
], | ||
#category : #'Telescope-Core-Tests-Model' | ||
} | ||
|
||
{ #category : #running } | ||
TLAbstractNodeTest >> setUp [ | ||
super setUp. | ||
node := TLAbstractNode new | ||
] | ||
|
||
{ #category : #tests } | ||
TLAbstractNodeTest >> testNotDuplicateAdjacentNodes [ | ||
| in inOut out adjacents | | ||
in:= TLAbstractNode withEntity: 'in'. | ||
inOut:= TLAbstractNode withEntity: 'inOut'. | ||
out:= TLAbstractNode withEntity: 'out'. | ||
TLConnection from: in to: node visualization: nil. | ||
TLConnection from: inOut to: node visualization: nil. | ||
TLConnection from: node to: inOut visualization: nil. | ||
TLConnection from: node to: out visualization: nil. | ||
adjacents:= node adjacentNodes. | ||
self assert: adjacents size equals: 3 | ||
] |
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 |
---|---|---|
@@ -1,71 +1,71 @@ | ||
Class { | ||
#name : #TLCompositeNodeTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'node' | ||
], | ||
#category : #'Telescope-Core-Tests-Model' | ||
} | ||
|
||
{ #category : #running } | ||
TLCompositeNodeTest >> setUp [ | ||
super setUp. | ||
node := TLCompositeNode new. | ||
node childrenNodeCreationStrategy: TLNodeCreationStrategy default. | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithBlock [ | ||
node entity: 42. | ||
node childrenProperty: [ :entity | | ||
self assert: entity equals: 42. | ||
#(1 2 3) ]. | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 1. | ||
self assert: node childrenNodes second entity equals: 2. | ||
self assert: node childrenNodes third entity equals: 3 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithCollectionOfEntities [ | ||
node childrenProperty: #(1 2 3). | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 1. | ||
self assert: node childrenNodes second entity equals: 2. | ||
self assert: node childrenNodes third entity equals: 3 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithProperty [ | ||
node entity: 30. | ||
node childrenProperty: #primeFactors. | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 2. | ||
self assert: node childrenNodes second entity equals: 3. | ||
self assert: node childrenNodes third entity equals: 5 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToAnother [ | ||
| childNode anotherNode | | ||
childNode := node addChildNodeFromEntity: #child. | ||
anotherNode := TLCompositeNode new. | ||
node childrenNodes first parent: anotherNode. | ||
self assert: node childrenNodes isEmpty. | ||
self assert: anotherNode childrenNodes size equals: 1. | ||
self assert: childNode parent equals: anotherNode | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToTheSame [ | ||
| childNode | | ||
childNode := node addChildNodeFromEntity: #child. | ||
childNode parent: node. | ||
childNode parent: node. | ||
self assert: node childrenNodes size equals: 1. | ||
self assert: childNode parent equals: node | ||
] | ||
Class { | ||
#name : #TLCompositeNodeTest, | ||
#superclass : #TestCase, | ||
#instVars : [ | ||
'node' | ||
], | ||
#category : #'Telescope-Core-Tests-Model' | ||
} | ||
|
||
{ #category : #running } | ||
TLCompositeNodeTest >> setUp [ | ||
super setUp. | ||
node := TLCompositeNode new. | ||
node childrenNodeCreationStrategy: TLNodeCreationStrategy default. | ||
|
||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithBlock [ | ||
node entity: 42. | ||
node childrenProperty: [ :entity | | ||
self assert: entity equals: 42. | ||
#(1 2 3) ]. | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 1. | ||
self assert: node childrenNodes second entity equals: 2. | ||
self assert: node childrenNodes third entity equals: 3 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithCollectionOfEntities [ | ||
node childrenProperty: #(1 2 3). | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 1. | ||
self assert: node childrenNodes second entity equals: 2. | ||
self assert: node childrenNodes third entity equals: 3 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testChildrenCreationWithProperty [ | ||
node entity: 30. | ||
node childrenProperty: #primeFactors. | ||
node createChildrenNodes. | ||
self assert: node childrenNodes size equals: 3. | ||
self assert: node childrenNodes first entity equals: 2. | ||
self assert: node childrenNodes second entity equals: 3. | ||
self assert: node childrenNodes third entity equals: 5 | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToAnother [ | ||
| childNode anotherNode | | ||
childNode := node addChildNodeFromEntity: #child. | ||
anotherNode := TLCompositeNode new. | ||
node childrenNodes first parent: anotherNode. | ||
self assert: node childrenNodes isEmpty. | ||
self assert: anotherNode childrenNodes size equals: 1. | ||
self assert: childNode parent equals: anotherNode | ||
] | ||
|
||
{ #category : #tests } | ||
TLCompositeNodeTest >> testMoveChildNodeFromOneParentToTheSame [ | ||
| childNode | | ||
childNode := node addChildNodeFromEntity: #child. | ||
childNode parent: node. | ||
childNode parent: node. | ||
self assert: node childrenNodes size equals: 1. | ||
self assert: childNode parent equals: node | ||
] |
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 |
---|---|---|
@@ -1,36 +1,36 @@ | ||
Class { | ||
#name : #TLConnectActionTest, | ||
#superclass : #TestCase, | ||
#category : #'Telescope-Core-Tests-Actions' | ||
} | ||
|
||
{ #category : #tests } | ||
TLConnectActionTest >> testTriggerAction [ | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectAction | ||
property: [ :e | {e sqrt} ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections size equals: 1. | ||
self assert: targetNode incomingConnections size equals: 1. | ||
self | ||
assert: sourceNode outgoingConnections anyOne | ||
equals: targetNode incomingConnections anyOne | ||
] | ||
|
||
{ #category : #tests } | ||
TLConnectActionTest >> testTriggerActionTwiceForReversibility [ | ||
"this test is valid only if testTriggerAction is valid" | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectAction | ||
property: [ :e | {e sqrt} ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections isEmpty. | ||
self assert: targetNode incomingConnections isEmpty | ||
] | ||
Class { | ||
#name : #TLConnectActionTest, | ||
#superclass : #TestCase, | ||
#category : #'Telescope-Core-Tests-Actions' | ||
} | ||
|
||
{ #category : #tests } | ||
TLConnectActionTest >> testTriggerAction [ | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectAction | ||
property: [ :e | {e sqrt} ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections size equals: 1. | ||
self assert: targetNode incomingConnections size equals: 1. | ||
self | ||
assert: sourceNode outgoingConnections anyOne | ||
equals: targetNode incomingConnections anyOne | ||
] | ||
|
||
{ #category : #tests } | ||
TLConnectActionTest >> testTriggerActionTwiceForReversibility [ | ||
"this test is valid only if testTriggerAction is valid" | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectAction | ||
property: [ :e | {e sqrt} ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections isEmpty. | ||
self assert: targetNode incomingConnections isEmpty | ||
] |
76 changes: 38 additions & 38 deletions
76
src/Telescope-Core-Tests/TLConnectWithEntityActionTest.class.st
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 |
---|---|---|
@@ -1,38 +1,38 @@ | ||
Class { | ||
#name : #TLConnectWithEntityActionTest, | ||
#superclass : #TestCase, | ||
#category : #'Telescope-Core-Tests-Actions' | ||
} | ||
|
||
{ #category : #tests } | ||
TLConnectWithEntityActionTest >> testTriggerAction [ | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectWithEntityAction | ||
connectionProperty: [ :e | {e squared} ] | ||
property: [ :connectionEntity | connectionEntity / 8 ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections size equals: 1. | ||
self assert: targetNode incomingConnections size equals: 1. | ||
self | ||
assert: sourceNode outgoingConnections anyOne | ||
equals: targetNode incomingConnections anyOne | ||
] | ||
|
||
{ #category : #tests } | ||
TLConnectWithEntityActionTest >> testTriggerActionTwiceForReversibility [ | ||
"this test is valid only if testTriggerAction is valid" | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectWithEntityAction | ||
connectionProperty: [ :e | {e squared} ] | ||
property: [ :connectionEntity | connectionEntity / 8 ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections isEmpty. | ||
self assert: targetNode incomingConnections isEmpty | ||
] | ||
Class { | ||
#name : #TLConnectWithEntityActionTest, | ||
#superclass : #TestCase, | ||
#category : #'Telescope-Core-Tests-Actions' | ||
} | ||
|
||
{ #category : #tests } | ||
TLConnectWithEntityActionTest >> testTriggerAction [ | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectWithEntityAction | ||
connectionProperty: [ :e | {e squared} ] | ||
property: [ :connectionEntity | connectionEntity / 8 ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections size equals: 1. | ||
self assert: targetNode incomingConnections size equals: 1. | ||
self | ||
assert: sourceNode outgoingConnections anyOne | ||
equals: targetNode incomingConnections anyOne | ||
] | ||
|
||
{ #category : #tests } | ||
TLConnectWithEntityActionTest >> testTriggerActionTwiceForReversibility [ | ||
"this test is valid only if testTriggerAction is valid" | ||
| connectAction sourceNode targetNode | | ||
sourceNode := TLSimpleNode withEntity: 4. | ||
targetNode := TLSimpleNode withEntity: 2. | ||
connectAction := TLConnectWithEntityAction | ||
connectionProperty: [ :e | {e squared} ] | ||
property: [ :connectionEntity | connectionEntity / 8 ] | ||
context: (TLDrawableCollection with: sourceNode with: targetNode). | ||
connectAction actionOn: sourceNode. | ||
connectAction actionOn: sourceNode. | ||
self assert: sourceNode outgoingConnections isEmpty. | ||
self assert: targetNode incomingConnections isEmpty | ||
] |
Oops, something went wrong.