ETHcode update v0.0.6 — Unit testing solidity with remix-tests
Solidity TDD focused development update. Compile solidity and run unit tests using remix-tests
framework.
Install ETHcode from Visual Studio Marketplace. ctrl+alt+e
activates the plugin. Press ctrl+alt+c
to compile and ctrl+alt+t
to run unit tests using ETHcode. Test file names should be like <filename>_test.sol
.
SafeMath unit testing
We used safeMath library from OpenZeppelin to perform some unit testing on uint
types. More details on safeMath
library github.
Import and use safeMath
library for arithmetic operations on uint
types.
Now all uint
types will be using SafeMath library.
String types unit testing using string utils
We used stringUtils library to perform some unit testing on string
types. More details on stringUtils
library on github.
First import and use stringUtils
for string
types.
We will use stringToUint
, stringCompare
, stringLen
, stringConcat
functions from stringUtils
library for performing various operations on string
types.
Bit operators unit testing
We used bits library from ethereum/solidity-examples to perform some unit testing on bits
types. More details on bits
library on github.
Import & use bits
library.
Then our bits
types unit tests are as follows
Full source can be found on our github repo — Click here
Ethcode gitter support channel —https://gitter.im/Ethereum-Devtools-Developers-Studio/ethcode
Help Quanta Network by donating Ethereum — 0xd22fE4aEFed0A984B1165dc24095728EE7005a36