01.02.2013 Views

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

Software Development Cross Solution - Index of - Free

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

You may need<br />

more-or<br />

fewer-lines to<br />

implement your<br />

solution... this<br />

is what it took<br />

to get our<br />

test written.<br />

package test.com.orionsorbits.mercurymeals;<br />

import com.orionsorbits.mercurymeals.*;<br />

import org.junit.*;<br />

public class TestMercuryMeals {<br />

String[] options;<br />

String flightNo;<br />

}<br />

@Before<br />

public void setUp() {<br />

options = {"Fish and chips");<br />

flightNo = "VS01";<br />

}<br />

@After<br />

public void tearDown() {<br />

options = null;<br />

flightNo = null;<br />

}<br />

@Test<br />

public void testOrderRegularMeal()<br />

throws MealOptionNotFoundException, OrderNotAcceptedException {<br />

}<br />

Your job is to create a unit test that exercises all <strong>of</strong> the functionality your user<br />

stories need. The “Order Regular Meal” test creates an order, adds a regular meal<br />

option to it (in this case, “Fish and chips”), and then submits the order to Mercury<br />

Meals. Using the class diagrams on the lefthand page, write the code for this test<br />

<strong>of</strong> the “Order Regular Meal” user story in the spaces provided below.<br />

This should be a valid meal option.<br />

The code for<br />

setUp() and<br />

tearDown() are<br />

already in place.<br />

Title:<br />

Priority:<br />

MercuryMeals mercuryMeals = MercuryMeals.getInstance();<br />

Download at WoweBook.Com<br />

Est:<br />

Order Regular Meal<br />

12 days<br />

10<br />

The user story this<br />

test focuses on.<br />

Throw a MealOptionNotFoundException<br />

if the meal isn’t found, and an<br />

OrderNotAcceptedException if the<br />

order can’t be submitted.<br />

bugs<br />

you are here 4 397

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!