🏗️」 wip: started doing the api for the contract

This commit is contained in:
2025-07-28 21:49:48 +02:00
parent 443a5a4099
commit 0449ad7ad2
7 changed files with 151 additions and 3 deletions

33
test/scoreStore.t.sol Normal file
View File

@ -0,0 +1,33 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;
import "src/contract/scoreStore.sol";
import "forge-std/Test.sol";
contract scoreStoreTest is Test {
scoreStore scoreS;
address nonOwner = address(1);
function setUp() public {
scoreS = new scoreStore();
}
function testAddScore() public {
uint id = scoreS.addScore("omg", "test", 5, 8);
score memory s = scoreS.getScore(id);
assertEq(s.p1, "omg");
assertEq(s.p2, "test");
assertEq(s.p1Score, 5);
assertEq(s.p2Score, 8);
id = scoreS.addScore("ahhhhh", "test", 7, 8);
s = scoreS.getScore(id);
assertEq(s.p1, "ahhhhh");
assertEq(s.p2, "test");
assertEq(s.p1Score, 7);
assertEq(s.p2Score, 8);
}
}