diff --git a/docs/images/a-plug.png b/docs/images/a-plug.png index 3161fe3a78..cde70b2d92 100644 Binary files a/docs/images/a-plug.png and b/docs/images/a-plug.png differ diff --git a/docs/images/a-unit-testing-feature.png b/docs/images/a-unit-testing-feature.png new file mode 100644 index 0000000000..34f39d1593 Binary files /dev/null and b/docs/images/a-unit-testing-feature.png differ diff --git a/docs/images/a-unit-testing-from-pm.png b/docs/images/a-unit-testing-from-pm.png new file mode 100644 index 0000000000..80f70e51b7 Binary files /dev/null and b/docs/images/a-unit-testing-from-pm.png differ diff --git a/docs/images/a-unit-testing-run-result.png b/docs/images/a-unit-testing-run-result.png new file mode 100644 index 0000000000..153519fa4d Binary files /dev/null and b/docs/images/a-unit-testing-run-result.png differ diff --git a/docs/images/a-unit-testing1.png b/docs/images/a-unit-testing1.png deleted file mode 100644 index 5e1b167584..0000000000 Binary files a/docs/images/a-unit-testing1.png and /dev/null differ diff --git a/docs/images/a-user-testing-icon.png b/docs/images/a-user-testing-icon.png new file mode 100644 index 0000000000..53db354e77 Binary files /dev/null and b/docs/images/a-user-testing-icon.png differ diff --git a/docs/unittesting.md b/docs/unittesting.md index 187755a60a..9c88a05c6f 100644 --- a/docs/unittesting.md +++ b/docs/unittesting.md @@ -1,38 +1,46 @@ Unit Testing ============ -Click the "double check" icon to get to the unit testing plugin. If you don't see this icon, go to the plugin manager and load up the unit testing plugin. +Click the +![double check](images/a-user-testing-icon.png) + icon to get to the "Solidity Unit Testing" plugin. If you don't see this icon, go to the plugin manager (by click the ![plug](images/a-plug.png) icon) and load up the unit testing plugin. -![](images/a-unit-testing1.png) +![](images/a-unit-testing-from-pm.png) -Generate test File +![](images/a-unit-testing-feature.png) + +Generating Test File ------------------ +Click the button "Generate test file" to create a new solidity file in the current folder. +This create a new solidity file suffixed with `_test`. +This file contains the minimum you need for running unit testing. -This create a new solidity file in the current folder suffixed with `_test`. -This file contains the minimun you need for running unit testing. +Running Tests +------------------ -Run Tests ---------- +Click the button "Run tests" to executes all tests whose box has been checked below (by default all). The execution is run in a separate environment and the result is displayed below. -This executes all tests whose box has been checked below (by default all). The execution is run in a separate environment and the result is displayed below. +![](images/a-unit-testing-run-result.png) Here is a list of functions and their supported types that you can use to write your testcases: -| Available functions | Supported types | - -| ------------- | ------------- | - -| `Assert.ok()` | `bool` | - -| `Assert.equal()` | `uint`, `int`, `bool`, `address`, `bytes32`, `string` | - -| `Assert.notEqual()` | `uint`, `int`, `bool`, `address`, `bytes32`, `string` | - -| `Assert.greaterThan()` | `uint`, `int` | - -| `Assert.lesserThan()` | `uint`, `int` | - -see [https://github.com/ethereum/remix/blob/master/remix-tests/tests/examples_4/SafeMath_test.sol](https://github.com/ethereum/remix/blob/master/remix-tests/tests/examples_4/SafeMath_test.sol) for some code sample +```eval_rst ++ -----------------------+--------------------------------------------------------+ +| Available functions | Supported types | ++========================+========================================================+ +| `Assert.ok()` | `bool` | ++------------------------+--------------------------------------------------------+ +| `Assert.equal()` | `uint`, `int`, `bool`, `address`, `bytes32`, `string` | ++------------------------+--------------------------------------------------------+ +| `Assert.notEqual()` | `uint`, `int`, `bool`, `address`, `bytes32`, `string` | ++------------------------+--------------------------------------------------------+ +| `Assert.greaterThan()` | `uint`, `int` | ++------------------------+--------------------------------------------------------+ +| `Assert.lesserThan()` | `uint`, `int` | ++------------------------+--------------------------------------------------------+ +``` + +Click [here](https://github.com/ethereum/remix/blob/master/remix-tests/tests/examples_4/SafeMath_test.sol) for a test file example Continuous integration ----------------------