Skip to content

Latest commit

 

History

History
75 lines (63 loc) · 1.23 KB

4_GetCarColorsTestCases.md

File metadata and controls

75 lines (63 loc) · 1.23 KB

Test cases for getCarColors

getCarColors(searchKey)

This methods returns an array of car colors with the given searchKey.

For example 1 returns

 [
    "white", "yellow", "blue"
]

If no car with the given searchKey is found return an empty array. If a parameter searchKey is missing, returns an empty array.

Test 1: searchKey 1

Test uses the default data.

Create register with default data.

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

expect

[
    "white", "yellow", "blue"
]

to be returned

Test 2: searchKey 5

Test uses the default data.

Create register with default data.

const register = new carRegister(defaultData);
register.getCarColors(5);

expect

[
    "red", "black", "orange"
]

to be returned

Test 3: searchKey 6 (Non-existing car)

Test uses the default data.

Create register with default data.

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

expect

[]

to be returned

Test 4: empty searchKey

Test uses the default data.

Create register with default data.

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

expect

[]

to be returned