Skip to content

Latest commit

 

History

History
39 lines (29 loc) · 786 Bytes

5_GetPriceTestCases.md

File metadata and controls

39 lines (29 loc) · 786 Bytes

Test cases for getPrice

getPrice(number)

This methods returns the price of a car with the given number.

For example 1 returns

 
    300

If no car with the given number is found throws an exeption 'nothing found with given number' If a parameter number is missing, throws an exeption 'missing parameter'

Test 1: number 1

Test uses the default data.

Create register with default data.

const register = new carRegister(defaultData);
register.getPrice(1);

expect

    300

to be returned

Test 2: nothing found with given number

Test uses the default data.

Create register with default data.

const register = new carRegister(defaultData);
register.getPrice(6);

throws an exeption 'nothing found with given number'