Skip to content

Test Cases

Setthanat Kladee edited this page Oct 21, 2021 · 47 revisions
Test ID Test Case Name Description Expected Result Actual Result Status
1 calulate user's age of user who was born on 10 Oct 2000 Calculate the age from the date of the person (calculate in the year 2021) The function should calculate the age correctly and return 21 Same as expected result ✔️
2 calulate user's age of user who was born on 31 Dec 2000 Calculate the age from the date of the person (calculate in the year 2021) The function should calculate the age correctly and return 20 Same as expected result ✔️
3 calulate user's age of user who was born today on year 2000 Calculate the age from the date of the person which dates passed for 1 year (calculate in the year 2021) The function should calculate the age correctly and return 21 Same as expected result ✔️
4 calulate user's age of user who was born on 1 Jan this year Calculate the age from the date of the person which dates not passed for 1 year yet (calculate in the year 2021) The function should calculate the age correctly and return 0 Same as expected result ✔️
5 calulate user's age of user who was born in the future Calculate the age from the date of the person which dates is the future dates (calculate in the year 2021) The function must throw an error message "you are using invalid date" The function did not throw an error message
6 calulate user's age with date 01 (have zero in front) Calculate the age from the date of the person which date is in abnormal format (calculate in the year 2021) The function should calculate the age correctly and return 21 Same as expected result ✔️
7 calulate user's age of user who was born in 'July' Calculate the age from the date of the person which month is in the wrong format (calculate in the year 2021) The function must throw an error message "you are using wrong date format" The function did not throw an error message
8 calulate user's age with empty string Calculate the age from the date of the person which date is empty (calculate in the year 2021) The function must throw an error message "you are using wrong date format" The function did not throw an error message
9 calulate user's age with format yyyy-mm-dd Calculate the age from the date of the person which date is in a different format (calculate in the year 2021) The function must throw an error message "you are using wrong date format" The function did not throw an error message
10 calulate user's age of user who was born on day 0 Calculate the age from the date of the person which date is 0 (calculate in the year 2021) The function must throw an error message "you are using invalid date" The function did not throw an error message
11 calulate user's age of user who was born on day -1 Calculate the age from the date of the person which date is a negative value (calculate in the year 2021) The function must throw an error message "you are using invalid date" The function did not throw an error message
12 calulate user's age with no '-' format Calculate the age from the date of the person which dates not include '-' in the format (calculate in the year 2021) The function must throw an error message "you are using wrong date format" The function did not throw an error message
13 calulate user's age with '/' format Calculate the age from the date of the person which dates include '/' in the format (calculate in the year 2021) The function must throw an error message "you are using wrong date format" The function did not throw an error message
14 calulate user's age with invalid month Calculate the age from the date of the person which month is invalid (calculate in the year 2021) The function must throw an error message "you are using invalid date" The function did not throw an error message
15 calulate user's age with invalid date Calculate the age from the date of the person which date is invalid (calculate in the year 2021) The function must throw an error message "you are using invalid date" The function did not throw an error message
16 check JSON have correct key&value The convertGovJson should generate JSON data from the given array correctly A JSON object which contains information from GOV array. We got JSON object which contains wrong date format
17 check JSON have all require field(eventhough value is undefine) Despite the GOV sending some incorrect data in an array, we still get the JSON object which contains all the important keys A JSON object which contains all keys. The JSON object does not contain the reservation_id key.
18 check JSON has valid reservation_id format Check when we generate the JSON object from the normal_young_user have the correct reservation_id format The JSON object as the output which contains correctly reservation_id format and has value 1 Same as expected result ✔️
19 check JSON has valid timestamp format Check when we generate the JSON object from the normal_young_user have the correct timestamp format The JSON object as the output which contains correctly timestamp format and has value 2021-10-20T15:19:56.609000 Same as expected result ✔️
20 check JSON has valid name format Check when we generate the JSON object from the normal_young_user have the correct valid name format The JSON object as the output which contains correctly valid name format and has the value "Joel" Same as expected result ✔️
21 check JSON has valid surname format Check when we generate the JSON object from the normal_young_user have the correct valid surname format The JSON object as the output which contains correctly valid surname format and has the value "Miller" Same as expected result ✔️
22 check JSON has valid date format Check when we generate the JSON object from the normal_young_user have the correct date format The JSON object as the output which contains correctly date format and has the value '20-10-2000' The JSON object["date"] is "2000-10-20" which is wrong format
23 check JSON has valid id format Check when we generate the JSON object from the normal_young_user have the correct id format The JSON object as the output which contains correctly id format and has the value "1234567890123" Same as expected result ✔️
24 check JSON has valid occupation format Check when we generate the JSON object from the normal_young_user have the correct occupation format The JSON object as the output which contains correctly occupation format and has the value "Teacher" Same as expected result ✔️
25 check JSON has valid address format Check when we generate the JSON object from the normal_young_user have the correct address format The JSON object as the output which contains correctly address format and has the value "Kasetsart University" Same as expected result ✔️
26 check modify normal date format Modifying the date format to replace '/' instead '-' The new format date from "10-20-2000" to "2000/20/10" Same as expected result ✔️
27 check modify invalid date format Modifying the date with format "01234-12233-200000000" to accepted format The date with format "200000000/12233/01234" Same as expected result ✔️
28 check number of element in list Check the number of elements in the list of people We should count the number of elements as 2 Same as expected result ✔️
29 check user order Check that each element in the list are in order Array with the 2 JSON objects which each object is in order Same as expected result ✔️
30 set priority for normal young user Set the priority for the normal_young_user(non-doctor or nurse) appropriately The normal_young_user should be prioritized in level 3 Same as expected result ✔️
31 set priority for normal old user Set the priority for the normal_old_user(older than 60 and non-doctor or nurse) appropriately The normal_old_user should be prioritized in level 2 Same as expected result ✔️
32 set priority for young Nurse (Nurse with caps 'N') Set the priority for the young_Nurse appropriately The setPriorityPerson function must set the priority of young_Nurse to be 1 The priority of young_Nurse is 3
33 set priority for young nurse Set the priority for the young_nurse appropriately The setPriorityPerson function must set the priority of young_nurse to be 1 Same as expected result ✔️
34 set priority for young Doctor(Doctor with 'D') Set the priority for the young_Doctor appropriately The setPriorityPerson function must set the priority of young_Doctor to be 1 The priority of young_Doctor is 3
35 set priority for young doctor Set the priority for the young_doctor appropriately The setPriorityPerson function must set the priority of young_doctor to be 1 Same as expected result ✔️
36 set priority for old doctor Set the priority for the old_doctor(older than 60) appropriately The old_doctor should be prioritized in level 1 Same as expected result ✔️
37 set priority for old nurse Set the priority for the old_nurse(older than 60) appropriately The old_nurse should be prioritized in level 1 Same as expected result ✔️
38 set priority for exact 60 user Set the priority of the normal_user who exact 60 years old The normal_user who exact 60 years old must be prioritized in level 3 The setPriorityPerson function set priority for these people as level 2
39 set priority for exact 61 user Set the priority of the normal_user who exact 61 years old The normal_user who exact 61 years old must be prioritized in level 2 Same as expected result ✔️
40 set priority for exact 59 user Set the priority of the normal_user who exact 59 years old The normal_user who exact 59 years old must be prioritized in level 3 Same as expected result ✔️

Clone this wiki locally