Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.

Commit

Permalink
test: add MoveSystemTest
Browse files Browse the repository at this point in the history
  • Loading branch information
alvrs committed Oct 4, 2022
1 parent 43ec5ba commit 098b4b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
28 changes: 0 additions & 28 deletions packages/contracts/src/test/systems/GameConfigSystem.t.sol

This file was deleted.

18 changes: 18 additions & 0 deletions packages/contracts/src/test/systems/MoveSystem.t.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SPDX-License-Identifier: Unlicense
pragma solidity >=0.8.0;

import "../MudTest.t.sol";
import { MoveSystem, ID as MoveSystemID } from "../../systems/MoveSystem.sol";
import { PositionComponent, ID as PositionComponentID, Coord } from "../../components/PositionComponent.sol";

contract MoveSystemTest is MudTest {
function testExecute() public {
uint256 entity = 1;
Coord memory coord = Coord(12, 34);
MoveSystem(system(MoveSystemID)).executeTyped(entity, coord);
PositionComponent positionComponent = PositionComponent(component(PositionComponentID));
Coord memory position = positionComponent.getValue(entity);
assertEq(position.x, coord.x);
assertEq(position.y, coord.y);
}
}

0 comments on commit 098b4b5

Please sign in to comment.