Exercise 16


Q1:

Assume you've written the following test for creating tasks in the XTrack system:

 public class TaskStoryTest {     public void testCreate() {       login("bob","bobspassword");       assertTrue( addTask( "User Gui",                            "Create GUI",                            "Bob",                            "2",                            "3",                            "Not Started" ) );    } } 

Indicate the modifications required to TaskStoryTest to make it run.

Q2:

Assume you've already gotten LoginStoryTest and UserIdStoryTest to run as illustrated in this chapter. Assume that the code in the XTrack system that creates tasks works as follows:

An XTrackTask class in the XTrack system represents a task. An XTrackTask has an add method that sets the task's name, description, assignee, estimate, actual, and status fields to values specified as parameters. If the specified values are all valid, it then attempts to add the task to the database. If the addition is successful, it returns true; otherwise, if the add fails or if any of the specified values is invalid, it returns false.

Show what you'd have to add to XTrackTest to call this code and make the TaskStoryTest run.



Testing Extreme Programming
Testing Extreme Programming
ISBN: 0321113551
EAN: 2147483647
Year: 2005
Pages: 238

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net