pragma solidity ^0.4.24; import "remix_tests.sol"; // this import is automatically injected by Remix. import "./timesheet.sol"; contract TimesheetTest { function testNoTimeUpdateAfterApproval() public { address employee = this; address boss = this; Timesheet timesheet = new Timesheet(employee, boss); uint _day = 1; timesheet.logWork(_day, 8); timesheet.approveWork(_day); timesheet.logWork(_day, 10); Assert.equal(timesheet.getHoursWorked(_day), uint(8), "hours worked should still be 8!"); } function testApprovalByBossOnly() public { address employee = this; address boss = 0x33eC1E7D89F78D4268747FBe99e9A484B5Cb1e47; Timesheet timesheet = new Timesheet(employee, boss); uint _day = 1; timesheet.logWork(_day, 8); timesheet.approveWork(_day); timesheet.logWork(_day, 10); Assert.equal(timesheet.getHoursWorked(_day), uint(10), "hours worked should be changed to 10!"); } }
0.4.18