File
Contents

File

Smart Contract //SPDX-License-Identifier: UNLICENSED pragma solidity >=0.5.0 <0.9.0;

contract Conditional { function check(uint256 a, uint256 b) public pure returns (uint256) { uint256 c; require(a > b, "a should be greater than b"); c = a; return c; } }

Test File

const Conditional = artifacts.require("Conditional");

contract("Conditional", () => { it("Should check whether a is greater than b", async () => { const conditional = await Cond...

User avatar

Writing tests in solidity

1 videos 1 exercises - 14min

Resources

1 exercises - 1min

Congratulations !!!

1 videos - 1min
 Enroll in the Course to Claim Certificate