Question: Software Design Help! 1) While doing Test Driven Development, what needs to change in the following code (marked in BOLD ) public class PayStationImpl implements
Software Design Help!
1)
While doing Test Driven Development, what needs to change in the following code (marked in BOLD)
public class PayStationImpl implements PayStation { public void addPayment( int coinValue ) throws IllegalCoinException { }
public int readDisplay() { return 0; }
If you are given the following test code (This test code below should not be changed you already created the test)
public class TestPayStation { /** * Entering 50 cents should make the display report 10 minutes * parking time. */ @Test public void shouldDisplay2MinFor5Cents() throws IllegalCoinException { PayStation ps = new PayStationImpl(); ps.addPayment( 50 ); assertEquals( "Should display 10 min for 50 cents", 10, ps.readDisplay() ); } } Group of answer choices
Nothing the code is working correctly
Return 0 should be changed to return 10
Return 0 should be changed to return 2
In the test code 50 should be 500
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
