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 uses the default data.
Create register with default data.
const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('VIP');
expect
300
to be returned
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 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 uses the default data
Create register with default data.
const register = new carRegister(defaultData);
register.getTotalPriceOfCarsByModel('');
an exeption 'missing parameter'
is thrown