|
| 1 | +from typing import cast |
1 | 2 | from unittest import TestSuite
|
2 | 3 | from unittest import main as unitTestMain
|
3 | 4 |
|
@@ -83,6 +84,22 @@ def testOglSdInstance(self):
|
83 | 84 | self.assertEqual('OzzeeInstance', oglSDInstance.pyutObject.instanceName, 'Incorrect instance name')
|
84 | 85 | self.assertEqual(200, oglSDInstance.pyutObject.instanceLifeLineLength, '')
|
85 | 86 |
|
| 87 | + def testOnlySingleLinksCreated(self): |
| 88 | + |
| 89 | + unTangleSequenceDiagram: UnTangleSequenceDiagram = self._untangleSequenceDiagramDocument() |
| 90 | + |
| 91 | + oglSDInstances: OglSDInstances = unTangleSequenceDiagram.oglSDInstances |
| 92 | + |
| 93 | + for sdInstance in oglSDInstances.values(): |
| 94 | + oglSDInstance: OglSDInstance = cast(OglSDInstance, sdInstance) |
| 95 | + instanceName: str = oglSDInstance.pyutObject.instanceName |
| 96 | + if instanceName == 'hasiiInstance': |
| 97 | + self.assertEqual(1, len(oglSDInstance.links), f'`{instanceName}` Should have a single message') |
| 98 | + elif instanceName == 'franInstance': |
| 99 | + self.assertEqual(3, len(oglSDInstance.links), f'`{instanceName}` Should have a single message') |
| 100 | + elif instanceName == 'OzzeeInstance': |
| 101 | + self.assertEqual(2, len(oglSDInstance.links), f'`{instanceName}` Should have a single message') |
| 102 | + |
86 | 103 | def _untangleSequenceDiagramDocument(self) -> UnTangleSequenceDiagram:
|
87 | 104 |
|
88 | 105 | root: Element = parse(V11_SEQUENCE_DIAGRAM_DOCUMENT)
|
|
0 commit comments