Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

README.md

Tutorial 1 - Basic tests

Exercises

Test 1. Numerical comparisons

Step 1. Structure of tests and syntax for test in JS

Create the file for the tests

  • Java: Make sure to include "Test" in the end of the filename

Create a named test with a function (JS) method (Java)

Step 2. introduce "matchers" or "assertions"

Step 3. Create a test to verify if a vehicle is affordable.

Test 2. String comparisons

  • Create a test to verify if a sentence ends with a period.

Test 3. Introduce array (for strings)

Create a new Java test class.

Declare a list of String with Swedish greetings.

Create some tests to verify:

  • If the list contains common Swedish greetings
  • If the list does not contain English greeting
  • If the list does not contain goodbye greeting

Test 2 b. Revisit test2

This time, code a function that should verify if a sentence ends with a period. Then test it!