This is a homework for the Java Loops
-
Clone this project to your local environment
git clone https://github.com/kermek/java-basics-hw07.git
-
Import in IntelliJ IDEA using
File -> New -> Project from Existing Sources...
. -
Select the directory that you cloned to.
-
Go through the
Import Project
wizard by clickingNext
. -
On
Please select project SDK
point it to your Java 1.8 JDK. -
Press
Ctrl+Alt+Shift+S
and check that in yourProject Structure
. value ofProject language level
is set to8 - Lambdas, type annotations et.
. -
Open test class, put your cursor on
@Test
annotation, pressAlt+Enter
and chooseAdd 'testng' to classpath
. -
Set the value to
org.testng:testng:6.14.3
and mark checkboxDownload to
. -
Complete all TODO tasks in the SumAverage class.
-
Execute tests.
-
Add 2 more tests for each method by adding more test data.
Implement methods in the SumAverage class. Arguments: lower bound, upper bound, and numbers array are valid integers. Lower bound is always less than or equals to upper bound. All test should pass. Add 2 more tests for each method by adding more test data.
There are number of different ways to run your unit tests, e.g.:
- In test class put your cursor on its definition, right click and choose
Run ...
- Right click on a little green triangle near the class definition and choose
Run ...
- In test class put your cursor on its definition and press
Ctrl+Shift+F10
- Once you executed your test you could re-run it again by pressing
Shift+F10