import static org.junit.Assert.*;

import java.util.ArrayList;

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

public class GildedRoseTest {

	
	private static final int STANDARD_DECAY = 1;
	private static final int EXPIRED_DECAY = 2*STANDARD_DECAY;
	
	private static final int ANY_QUALITY = 40;
	private static final int ANY_SELLIN = 14;
	
	private static final int EXPIRED_SELLIN = 0;

	Item product;

	@Before
	public void setUp() {

		GildedRose.items = new ArrayList<Item>();
		product = new Item("ANY_NAME", ANY_SELLIN, ANY_QUALITY);
		GildedRose.items.add(product);

	}

	@Test
	public void qualityShouldDecay() {

		GildedRose.updateQuality();

		assertEquals("Quality should have decay", ANY_QUALITY - STANDARD_DECAY,
				product.getQuality());
	}

	@Test
	public void qualityDecayFasterWhenExpired() {
		product.setSellIn(EXPIRED_SELLIN);

		GildedRose.updateQuality();

		assertEquals("Quality should  decay faster",
				ANY_QUALITY - EXPIRED_DECAY  , product.getQuality());

	}

}

@@ -139,16 +139,52 @@
 st %7B%0A%0A%09%0A
+%09private static final int ZERO = 0;%0A
 %09private
@@ -1020,12 +1020,276 @@
 ());%0A%0A%09%7D
+%0A%09%0A%09@Test%0A%09public void qualityIsNeverNegative() %7B%0A%09%09product.setQuality(ZERO);%0A%09%09%0A%09%09GildedRose.updateQuality();%0A%09%09%0A%09%09assertFalse(%22Quality should not be negative%22, isQualityNegative());%0A%09%7D%0A%0A%09private boolean isQualityNegative() %7B%0A%09%09return product.getQuality() %3C 0;%0A%09%7D
 %0A%0A%7D%0A

add quality never negative test