Lab7_Solution

pdf

School

University of Toronto *

*We aren’t endorsed by this school

Course

350

Subject

Computer Science

Date

Dec 6, 2023

Type

pdf

Pages

3

Uploaded by MagistrateWorldChinchilla30

Report
MIE 350 Lab 7 Solutions Question 4 Solutions Question 4 requires you to implement 2 test cases: 1. If we add a professor and their salary is less than $30,000, we need to make sure our code bumped them up to $30,000 2. If their salary is higher than $30,000, don’t touch it. Test case 1: rofessorJSON.put("i yrofessorJSON.put( yrofessorJSON.put( yrofessorJSON.put(" yrofessorJSON.put(" Yo [o Yol go] Yo g ={<ld (o] §) addedProfessor.getFirstNa Lo [o LYo 1 o{T0) (Yo (I {IE N A\ ET g E14) com", addedProfessor.getEm
Test case 2: rofessorJSON.put("id' yrofessorJSON.put( yrofessorJSON.put( rofessorJSON.put(" Yo [o Yol go] Yo g ={<ld (o] §) EL o [1e [ ol LRI #-LUEATS A\ E Lo [o LYo 1 o{T0) (Yo (I {IE N A\ ET g E14) com", addedProfessor.getEm Homework: a. Thecodeincludesanothertestsuite,CourseProfessorTests,thathasonetestcase. Readthetest casecodeand makesureyouunderstandit.Then,answerthefollowing questions: i. Provideashortdescriptionofthetest case. This test case creates a new professor using the professors’ REST controller, then creates a new course using the courses’ REST controller with the previously added professor associated with the course. It then retrieves the newly added course from the course repository as well as the associated professor and verifies that the course details and the professor details are as expected.
ii. How manyrepositoriesandhowmanycontrollersareinvolvedinthistest case? 2 controllers: Professor (Adds professor) & Course (Adds course). 1 Repository: Course repository (To retrieve details of course). iii. Describe theroles of courseJson and addedCourse and the differences between them. 1. courselson: This is a JSON object that stores details of the course to be added via the course REST controller (therefore must be in JSON format). Unlike addedCourse, this is a JSON object and not an instance of the Course Class. addedCourse: This is an instance of the Course class (entity). It is retrieved from the course repository (i.e., it represents a record in the database). This course was created after the courselson was submitted to the course REST controller and saved to the repository by the controller.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help