Skip to content

Commit

Permalink
Fixed remaining testcases
Browse files Browse the repository at this point in the history
  • Loading branch information
Luca Topolovec committed Mar 4, 2024
1 parent f41047f commit 529a1c1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/CattyTests/Bricks/MoveNStepsBrickTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ final class MoveNStepsBrickTests: AbstractBrickTest {
let project = ProjectMock(width: CGFloat(SCREEN_WIDTH), andHeight: CGFloat(SCREEN_HEIGHT))
project.scenes.add(scene)
scene.project = project
project.activeScene = scene

self.stage = StageBuilder(project: project).build()

Expand Down
10 changes: 6 additions & 4 deletions src/CattyTests/Bricks/ShowTextBrickTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,11 @@ final class ShowTextBrickTests: XCTestCase {
let expectedPos = CGPoint(x: stageSize.width / 2 + pos.x, y: stageSize.height / 2 + pos.y)

let userVariable = UserVariable(name: "testName")
userVariable.textLabels["Scene 1"] = SKLabelNode()

let label = SKLabelNode()
userVariable.textLabels["testScene"] = label
let stage = SKScene(size: stageSize)
stage.addChild(userVariable.textLabels["Scene 1"]!)
stage.addChild(label)

let brick = ShowTextBrick()
brick.script = script
Expand All @@ -91,8 +93,8 @@ final class ShowTextBrickTests: XCTestCase {

executeInstruction(for: brick)

XCTAssertEqual(expectedPos.x, userVariable.textLabels["Scene 1"]?.position.x)
XCTAssertEqual(expectedPos.y, userVariable.textLabels["Scene 1"]?.position.y)
XCTAssertEqual(expectedPos.x, userVariable.textLabels["testScene"]?.position.x)
XCTAssertEqual(expectedPos.y, userVariable.textLabels["testScene"]?.position.y)
}

private func executeInstruction(for brick: CBInstructionProtocol) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ final class StagePresenterViewControllerTest: XCTestCase {
CBFileManager.shared()?.addDefaultProjectToProjectsRootDirectoryIfNoProjectsExist()
Util.setLastProjectWithName(kDefaultProjectBundleName, projectID: kNoProjectIDYetPlaceholder)

vc.stageManager = StageManager(project: project)
XCTAssertNil(navigationController.currentViewController)

vc.checkResourcesAndPushViewController(to: navigationController)
Expand Down

0 comments on commit 529a1c1

Please sign in to comment.