Simple Java project to teach Unit and Integration testing
mvn clean verify
BEFORE STARTING, CHECKOUT A NEW BRANCH AND NAME IT: yourFirstName-surname
eg. paddy-fox
.
- Add meaningful error message to the assertion in
postcodeValidatorValidPostcodeTest()
- Work out the
postcodeValidator
regex and change the expected value inpostcodeValidatorValidPostcodeTest
unit test so that it passes. - Complete the
postcodeValidatorMultipleInvalidPostcodesTest
test so that it verifies multiple postcode examples, all of which fail the regex checks.
(TDD APPROACH):
4. Create unit tests for the roadNameValidator
which tests positive/negative scenarios.
5. Create a roadNameValidator
which accepts a String road name variable which only allows characters in the alphabet.
(TDD APPROACH):
- Create unit tests for the
houseNumberValidator
which tests positive/negative/boundary scenarios - remember to always make sure the test can also fail. - Create a
houseNumberValidator
which accepts a numeric house number variable which has maximum of 2 digits starting from number 1.
(CHOOSE YOUR OWN APPROACH):
- Write a function with unit tests to determine whether a value is a prime number. It should return true or false if the value is an integer in the range 2 - 1000000000 inclusive, else it should throw an error.