-
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.
- Loading branch information
Showing
19 changed files
with
149 additions
and
35 deletions.
There are no files selected for viewing
36 changes: 29 additions & 7 deletions
36
...penPonk-Core/OPAbstractShapeTest.class.st → ...ore/OPAbstractDiagramElementTest.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
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
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 |
---|---|---|
@@ -0,0 +1,51 @@ | ||
Class { | ||
#name : 'OPAbstractNodeTest', | ||
#superclass : 'OPAbstractDiagramElementTest', | ||
#category : 'OpenPonk-Core-Tests', | ||
#package : 'OpenPonk-Core', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'tests' } | ||
OPAbstractNodeTest >> testDoesNotMoveOnShapeCreation [ | ||
|
||
| diagram originalRoassalPosition movedRoassalPosition newShape | | ||
diagram := OPDiagram new. | ||
diagram renderIn: canvas. | ||
shape owningElement: diagram. | ||
shape modelElement: model. | ||
shape renderIn: canvas. | ||
shape isPositionableByUser ifFalse: [ ^ self ]. | ||
originalRoassalPosition := shape roassalShape position. | ||
shape updateFromRender. | ||
self assert: shape bounds position equals: originalRoassalPosition. | ||
shape roassalShape translateBy: 100 @ 50. | ||
movedRoassalPosition := shape roassalShape position. | ||
self | ||
assert: movedRoassalPosition | ||
equals: originalRoassalPosition + (100 @ 50). | ||
self assert: shape bounds position equals: originalRoassalPosition. | ||
newShape := OPTestLabel in: diagram. | ||
newShape renderIn: canvas. | ||
self assert: shape bounds position equals: originalRoassalPosition. | ||
self assert: shape roassalShape position equals: movedRoassalPosition | ||
] | ||
|
||
{ #category : 'tests' } | ||
OPAbstractNodeTest >> testUpdateFromRender [ | ||
|
||
| originalBounds movedBounds | | ||
self assert: shape bounds equals: nil. | ||
shape modelElement: model. | ||
shape renderIn: canvas. | ||
shape updateFromRender. | ||
shape isPositionableByUser ifFalse: [ ^ self ]. | ||
originalBounds := shape bounds veryDeepCopy. | ||
shape roassalShape translateBy: 100 @ 50. | ||
self assert: shape bounds position equals: originalBounds position. | ||
shape updateFromRender. | ||
movedBounds := shape bounds veryDeepCopy. | ||
self deny: movedBounds position equals: originalBounds position. | ||
self assert: movedBounds position equals: originalBounds position + (100 @ 50). | ||
|
||
] |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Class { | ||
#name : 'OPDiagramView', | ||
#superclass : 'OPLegacyDiagram', | ||
#category : 'OpenPonk-Core-Diagrams', | ||
#category : 'OpenPonk-Core-LegacySupport-Diagrams', | ||
#package : 'OpenPonk-Core', | ||
#tag : 'Diagrams' | ||
#tag : 'LegacySupport-Diagrams' | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Class { | ||
#name : 'OPDiagramViewInfo', | ||
#superclass : 'OPDiagramInfo', | ||
#category : 'OpenPonk-Core-Diagrams', | ||
#category : 'OpenPonk-Core-LegacySupport-Diagrams', | ||
#package : 'OpenPonk-Core', | ||
#tag : 'Diagrams' | ||
#tag : 'LegacySupport-Diagrams' | ||
} |
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
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
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
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
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
Class { | ||
#name : 'OPNoteTest', | ||
#superclass : 'OPAbstractNodeTest', | ||
#category : 'OpenPonk-Core-Tests', | ||
#package : 'OpenPonk-Core', | ||
#tag : 'Tests' | ||
} | ||
|
||
{ #category : 'instance creation' } | ||
OPNoteTest >> newModelInstance [ | ||
|
||
^ nil | ||
] | ||
|
||
{ #category : 'hooks' } | ||
OPNoteTest >> shapeClass [ | ||
^ OPNote | ||
] | ||
|
||
{ #category : 'instance creation' } | ||
OPNoteTest >> testEmpty [ | ||
|
||
self skip | ||
] |