Skip to content

Commit

Permalink
testing setting in MiDependencyStructuralMatrixBrowserModel
Browse files Browse the repository at this point in the history
  • Loading branch information
anquetil committed Dec 8, 2024
1 parent cf2ecdf commit 870ea4e
Showing 1 changed file with 67 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,28 @@ MiDependencyStructuralMatrixBrowserTest >> testDoesNotOpenEmptyDetailedDSM [
self assert: detailedDSM isNil
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testDontShowSelfDependenciesHideDiagonalWeight [

| tuple |
browser model settings setItem: #selfDependenciesSetting value: false.
tuple := (AITarjanNode with: #entityA) -> (AITarjanNode with: #entityA).
browser model dependencyDictionary: (Dictionary newFromPairs: { (#entityA -> #entityA) . #(1 2 3) }).

self assert: (browser model getTupleDependencyWeight: tuple) equals: 0.
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testDontShowSelfDependenciesShowNonDiagonalWeight [

| tuple |
browser model settings setItem: #selfDependenciesSetting value: false.
tuple := (AITarjanNode with: #entityA) -> (AITarjanNode with: #entityB).
browser model dependencyDictionary: (Dictionary newFromPairs: { (#entityA -> #entityB) . #(1 2 3) }).

self assert: (browser model getTupleDependencyWeight: tuple) equals: 3.
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testDoubleClickCallsUserAction [
"sets a fake spec model on the visualization to check that #userAction: is called
Expand Down Expand Up @@ -213,6 +235,51 @@ MiDependencyStructuralMatrixBrowserTest >> testOutgoingDependencyFromVariableDec
]
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testSettingsAction [

self assert: browser hasSettings
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testSettingsChanged [

| stubDSM redrawn |
redrawn := false.
stubDSM := Mock new.
stubDSM stub run will: [ redrawn := true ].
browser mainPresenter: stubDSM.

browser model settingsChanged: true.

self assert: redrawn
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testSettingsNotChanged [

| stubDSM redrawn |
redrawn := false.
stubDSM := Mock new.
stubDSM stub run will: [ redrawn := true ].
browser mainPresenter: stubDSM.

browser model settingsChanged: false.

self deny: redrawn
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testShowSelfDependenciesDoNotHideDiagonalWeight [

| tuple |
browser model settings setItem: #selfDependenciesSetting value: true.
tuple := (AITarjanNode with: #entityA) -> (AITarjanNode with: #entityA).
browser model dependencyDictionary: (Dictionary newFromPairs: { (#entityA -> #entityA) . #(1 2 3) }).

self assert: (browser model getTupleDependencyWeight: tuple) equals: 3.
]

{ #category : #tests }
MiDependencyStructuralMatrixBrowserTest >> testTitleOfDSM [

Expand Down

0 comments on commit 870ea4e

Please sign in to comment.