mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-18 07:51:29 +00:00
✅ improve unit tests
This commit is contained in:
parent
32cbb6f2e0
commit
7a609b11f1
@ -6,8 +6,7 @@ import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static com.gildedrose.helper.TestHelper.testItem;
|
||||
import static com.gildedrose.helper.TestHelper.testItemException;
|
||||
import static com.gildedrose.helper.TestHelper.*;
|
||||
import static com.gildedrose.items.AgedBrieItem.AGED_BRIE;
|
||||
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
@ -15,6 +14,7 @@ class AgedBrieItemTest {
|
||||
|
||||
private final Item item = new Item(AGED_BRIE, 5, 20);
|
||||
private final Item itemError = new Item(AGED_BRIE, 10, -5);
|
||||
private final Item itemAboveLimitQuality = new Item(AGED_BRIE, 10, 60);
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
@ -34,4 +34,10 @@ class AgedBrieItemTest {
|
||||
testItemException(itemError);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(4)
|
||||
void QualityAboveLimitFail() {
|
||||
testItemQualityAboveLimitException(itemAboveLimitQuality);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,8 +6,7 @@ import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static com.gildedrose.helper.TestHelper.testItem;
|
||||
import static com.gildedrose.helper.TestHelper.testItemException;
|
||||
import static com.gildedrose.helper.TestHelper.*;
|
||||
import static com.gildedrose.items.BackstagePassItem.BACKSTAGE_PASS;
|
||||
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
@ -15,6 +14,7 @@ class BackstagePassItemTest {
|
||||
|
||||
private final Item item = new Item(BACKSTAGE_PASS, 15, 20);
|
||||
private final Item itemError = new Item(BACKSTAGE_PASS, 10, -5);
|
||||
private final Item itemAboveLimitQuality = new Item(BACKSTAGE_PASS, 10, 60);
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
@ -41,9 +41,15 @@ class BackstagePassItemTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(2)
|
||||
@Order(5)
|
||||
void negativeQualityFail() {
|
||||
testItemException(itemError);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(6)
|
||||
void QualityAboveLimitFail() {
|
||||
testItemQualityAboveLimitException(itemAboveLimitQuality);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -6,8 +6,7 @@ import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static com.gildedrose.helper.TestHelper.testItem;
|
||||
import static com.gildedrose.helper.TestHelper.testItemException;
|
||||
import static com.gildedrose.helper.TestHelper.*;
|
||||
import static com.gildedrose.items.ConjuredItem.CONJURED;
|
||||
|
||||
@TestMethodOrder(OrderAnnotation.class)
|
||||
@ -15,6 +14,7 @@ class ConjuredItemTest {
|
||||
|
||||
private final Item item = new Item(CONJURED, 5, 20);
|
||||
private final Item itemError = new Item(CONJURED, 10, -5);
|
||||
private final Item itemAboveLimitQuality = new Item(CONJURED, 10, 60);
|
||||
|
||||
@Test
|
||||
@Order(1)
|
||||
@ -33,4 +33,10 @@ class ConjuredItemTest {
|
||||
void negativeQualityFail() {
|
||||
testItemException(itemError);
|
||||
}
|
||||
|
||||
@Test
|
||||
@Order(4)
|
||||
void QualityAboveLimitFail() {
|
||||
testItemQualityAboveLimitException(itemAboveLimitQuality);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user