Skip to content

Commit

Permalink
gute Testarchitektur
Browse files Browse the repository at this point in the history
  • Loading branch information
JoRost committed Jun 25, 2024
1 parent 76ca066 commit b176a15
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ testMoveLayerDown
tileMatrixStack:= self editor tileMap tileMatrixStack.
self editor addLayer.
layer1 := tileMatrixStack matrixLayers at: 1.
layerId1 := (tileMatrixStack matrixLayers at: 1) layerIdx.
layerId2 := (tileMatrixStack matrixLayers at: 2) layerIdx.
layerId1 := (tileMatrixStack matrixLayers at: 1) layerIndex.
layerId2 := (tileMatrixStack matrixLayers at: 2) layerIndex.
self editor moveLayerDown.
self assert: (tileMatrixStack matrixLayers at: 1) layerIdx = layerId1.
self assert: (tileMatrixStack matrixLayers at: 2) layerIdx = layerId2.
self assert: (tileMatrixStack matrixLayers at: 1) layerIndex = layerId1.
self assert: (tileMatrixStack matrixLayers at: 2) layerIndex = layerId2.
self assert: (tileMatrixStack matrixLayers at: 2) == layer1.
self assert: ((tileMatrixStack matrixLayers at: 1) == layer1) not
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ testMoveLayerUp
tileMatrixStack:= self editor tileMap tileMatrixStack.
self editor addLayer.
layer1 := tileMatrixStack matrixLayers at: 1.
layerId1 := (tileMatrixStack matrixLayers at: 1) layerIdx.
layerId2 := (tileMatrixStack matrixLayers at: 2) layerIdx.
layerId1 := (tileMatrixStack matrixLayers at: 1) layerIndex.
layerId2 := (tileMatrixStack matrixLayers at: 2) layerIndex.
self editor selectOnlyLayer: 1.
self editor moveLayerUp.
self assert: (tileMatrixStack matrixLayers at: 1) layerIdx = layerId1.
self assert: (tileMatrixStack matrixLayers at: 2) layerIdx = layerId2.
self assert: (tileMatrixStack matrixLayers at: 1) layerIndex = layerId1.
self assert: (tileMatrixStack matrixLayers at: 2) layerIndex = layerId2.
self assert: (tileMatrixStack matrixLayers at: 2) == layer1.
self assert: ((tileMatrixStack matrixLayers at: 1) == layer1) not
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ testSwapLayer
TileMatrixStack:= self editor tileMap tileMatrixStack.
self editor addLayer.
layer1 := TileMatrixStack matrixLayers at: 1.
layerId1 := (TileMatrixStack matrixLayers at: 1) layerIdx.
layerId2 := (TileMatrixStack matrixLayers at: 2) layerIdx.
layerId1 := (TileMatrixStack matrixLayers at: 1) layerIndex.
layerId2 := (TileMatrixStack matrixLayers at: 2) layerIndex.
TileMatrixStack swapLayer: 1 with: 2.
self assert: (TileMatrixStack matrixLayers at: 1) layerIdx = layerId1.
self assert: (TileMatrixStack matrixLayers at: 2) layerIdx = layerId2.
self assert: (TileMatrixStack matrixLayers at: 1) layerIndex = layerId1.
self assert: (TileMatrixStack matrixLayers at: 2) layerIndex = layerId2.
self assert: (TileMatrixStack matrixLayers at: 2) == layer1.
self assert: ((TileMatrixStack matrixLayers at: 1) == layer1) not
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
layerTests
testToggleHighlightingLayer
"tests the visibility toggle for the visual layer"

self editor toggleGrid.
self assert: (self editor tileMap tileMatrixStackHighlighting layer: 1) visible = false.
self editor toggleGrid.
self assert: (self editor tileMap tileMatrixStackHighlighting layer: 1) visible = true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"fileUUID:" : "jj 6/22/2024 16:55",
"loadTestMapFileToFileDirectory" : "JS 6/23/2024 18:18",
"setUp" : "jj 6/23/2024 18:55",
"setup" : " 6/24/2024 10:17:32",
"setup" : "6/24/2024 10:17:32",
"tearDown" : "jj 6/22/2024 20:24",
"testAddLayerButton" : "JS 6/24/2024 00:19",
"testDeleteLayer" : "jj 6/22/2024 20:25",
Expand All @@ -18,12 +18,12 @@
"testExport" : "jj 6/23/2024 19:02",
"testExportButton" : "jj 6/22/2024 20:28",
"testImportButton" : "jj 6/22/2024 20:28",
"testMoveLayerDown" : "jj 6/22/2024 20:31",
"testMoveLayerUp" : "jj 6/22/2024 20:31",
"testMoveLayerDown" : "JS 6/25/2024 18:02",
"testMoveLayerUp" : "JS 6/25/2024 18:02",
"testMultiDeleteLayer" : "jj 6/22/2024 20:31",
"testMultiToggleLayerVisibility" : "jj 6/22/2024 20:34",
"testRenameLayer" : "JS 6/24/2024 00:15",
"testRescaleMap" : "jj 6/22/2024 20:32",
"testSwapLayer" : "jj 6/22/2024 20:33",
"testToggleLayerVisibility" : "jj 6/22/2024 20:34",
"testToggleHighlightingLayer" : "jj 6/22/2024 20:34" } }
"testSwapLayer" : "JS 6/25/2024 18:03",
"testToggleHighlightingLayer" : "jj 6/22/2024 20:34",
"testToggleLayerVisibility" : "jj 6/22/2024 20:34" } }
Binary file modified testMapFile.morph
Binary file not shown.

0 comments on commit b176a15

Please sign in to comment.