Author | Message |
---|---|
Anonymous
Posts: 166
|
Posted 22:07 Mar 11, 2014 |
Either I have done something wrong, or there is something wrong with the test. the array for first_moves = 25, 10, 10. the array for second_moves = 5, 20, 10. assertEquals(80, result[0]); first player wins the first bid, so 100 - 25 = 75. the first player loses the second bid, but wins the third bid because the first player holds the draw. therefore, 75 - 10 should equal 65, not 80, as presented in the assertEquals. Right?
|
Anonymous
Posts: 166
|
Posted 22:13 Mar 11, 2014 |
just kidding, I found my error. |
lakerfan94
Posts: 143
|
Posted 22:15 Mar 11, 2014 |
Yes, that's right, so change the assertEquals accordingly to what you said the expected value should be. |
lakerfan94
Posts: 143
|
Posted 22:15 Mar 11, 2014 |
Never mind my reply then. |
Eric Liao
Posts: 158
|
Posted 22:17 Mar 11, 2014 |
Remember that the player variable at this test case is 2, not 1. Therefore result[0] should be second player's money. In other word, the test case expected result is correct. |