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.
- Work out the
postcodeValidatorregex and change the expected value inpostcodeValidatorValidPostcodeTestunit test so that it passes. - Complete the
postcodeValidatorMultipleInvalidPostcodesTesttest so that it can accept multiple postcode examples, all of which fail the regex checks.
(TDD APPROACH):
3. Create unit tests for the roadNameValidator which tests positive/negative scenarios.
4. Create a roadNameValidator which accepts a String road name variable which only allows characters in the alphabet.
(TDD APPROACH):
- Create unit tests for the
houseNumberValidatorwhich tests positive/negative/boundary scenarios - remember to always make sure the test can also fail. - Create a
houseNumberValidatorwhich accepts a numeric house number variable which is always exactly 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 - 1000000000000 inclusive, else it should throw an error.