Skip to content

Latest commit

 

History

History
61 lines (49 loc) · 1.49 KB

2_GetTotalPriceOfCarsByModelTestCases.md

File metadata and controls

61 lines (49 loc) · 1.49 KB

Test cases for getTotalPriceOfCarsByModel

getTotalPriceOfCarsByModel(searchValue)

Methods returns an array of total price of all cars 300 belonging to given (searchValue) model of car VIP.

For example silver returns

159 //Adding the prices of all the models of silver i.e 36+123.

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

Test 1: VIP

Test uses the default data.

Create register with default data.

const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('VIP');

expect

300

to be returned

Test 2: Silver

Test uses the default data

Create register with default data.

const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('silver');

expect

159 //Adding the prices of all the models of silver i.e 36+123.

to be returned

Test 3: nothing found with given searchValue

Test uses the default data

Create register with default data.

const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('x');

throws an exeption 'nothing found with given searchValue'

Test 4: missing parameter

Test uses the default data

Create register with default data.

const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('');

an exeption 'missing parameter' is thrown