package shoppingapp.boundary;

import static org.junit.Assert.assertArrayEquals;

import java.math.BigDecimal;

import org.junit.Before;
import org.junit.Test;

import shoppingapp.boundary.Boundary;
import shoppingapp.boundary.driven_port.Display;
import shoppingapp.boundary.internal.domain.PaymentDetails;
import shoppingapp.boundary.internal.domain.Product;
import shoppingapp.boundary.internal.domain.ShippingInformation;
import shoppingapp.boundary.internal.domain.Stock;
import shoppingapp.boundary.stubs.DisplayStub;
import shoppingapp.command.AddsProductToCart;
import shoppingapp.command.ConfirmsPurchase;
import shoppingapp.command.EntersPaymentDetails;
import shoppingapp.command.EntersShippingInformation;
import shoppingapp.command.ChecksOutPurchase;

public class BoundaryTest {
	private Boundary boundary;

	@Before
	public void setUp() throws Exception {
		Stock stock = new Stock();
		Display displayStub = new DisplayStub();
		boundary = new Boundary(stock, displayStub);
		boundary.run();
	}

	@Test
	public void runsBasicFlow() {
		boundary.reactTo(new AddsProductToCart(new Product("Hamster Wheel, Black", new BigDecimal(9.95))),
				new ChecksOutPurchase(), new EntersShippingInformation(new ShippingInformation()),
				new EntersPaymentDetails(new PaymentDetails()), new ConfirmsPurchase());

		assertRecordedStepNames("S1", "S2", "S3", "S4", "S5", "S6", "S7", "S8", "S9", "S10", "S11", "S1", "S2");
	}

	protected void assertRecordedStepNames(String... expectedStepNames) {
		String[] actualStepNames = boundary.getRecordedStepNames();
		assertArrayEquals(expectedStepNames, actualStepNames);
	}
}

@@ -158,46 +158,8 @@
 t;%0A%0A
-import shoppingapp.boundary.Boundary;%0A
 impo
@@ -525,16 +525,62 @@
 ToCart;%0A
+import shoppingapp.command.ChecksOutPurchase;%0A
 import s
@@ -722,54 +722,8 @@
 ion;
-%0Aimport shoppingapp.command.ChecksOutPurchase;
 %0A%0Apu

Remove unused imports