mirror of
https://github.com/ysoftdevs/Theatrical-Players-Refactoring-Kata.git
synced 2026-01-11 22:30:27 +01:00
added example tests
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
<html>
|
||||||
|
<h1>Statement for BigCo</h1>
|
||||||
|
<table>
|
||||||
|
<tr><th>play</th><th>seats</th><th>cost</th></tr>
|
||||||
|
<tr><td>Hamlet</td><td>55</td><td>$650.00</td></tr>
|
||||||
|
<tr><td>As You Like It</td><td>35</td><td>$580.00</td></tr>
|
||||||
|
<tr><td>Othello</td><td>40</td><td>$500.00</td></tr>
|
||||||
|
</table>
|
||||||
|
<p>Amount owed is <em>$1,730.00</em></p>
|
||||||
|
<p>You earned <em>47</em> credits</p>
|
||||||
|
</html>
|
||||||
@@ -9,7 +9,7 @@ import static org.approvaltests.Approvals.verify;
|
|||||||
public class StatementPrinterTests {
|
public class StatementPrinterTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void exampleStatement() {
|
void exampleStatementPlainText() {
|
||||||
Map<String, Play> plays = Map.of(
|
Map<String, Play> plays = Map.of(
|
||||||
"hamlet", new Play("Hamlet", "tragedy"),
|
"hamlet", new Play("Hamlet", "tragedy"),
|
||||||
"as-like", new Play("As You Like It", "comedy"),
|
"as-like", new Play("As You Like It", "comedy"),
|
||||||
@@ -26,6 +26,25 @@ public class StatementPrinterTests {
|
|||||||
verify(result);
|
verify(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
void exampleStatementHtml() {
|
||||||
|
Map<String, Play> plays = Map.of(
|
||||||
|
"hamlet", new Play("Hamlet", "tragedy"),
|
||||||
|
"as-like", new Play("As You Like It", "comedy"),
|
||||||
|
"othello", new Play("Othello", "tragedy"));
|
||||||
|
|
||||||
|
Invoice invoice = new Invoice("BigCo", List.of(
|
||||||
|
new Performance("hamlet", 55),
|
||||||
|
new Performance("as-like", 35),
|
||||||
|
new Performance("othello", 40)));
|
||||||
|
|
||||||
|
StatementPrinter statementPrinter = new StatementPrinter();
|
||||||
|
|
||||||
|
// Not implemented yet
|
||||||
|
// var result = statementPrinter.printAsHtml(invoice, plays);
|
||||||
|
// verify(result);
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void statementWithNewPlayTypes() {
|
void statementWithNewPlayTypes() {
|
||||||
Map<String, Play> plays = Map.of(
|
Map<String, Play> plays = Map.of(
|
||||||
@@ -37,6 +56,8 @@ public class StatementPrinterTests {
|
|||||||
new Performance("as-like", 55)));
|
new Performance("as-like", 55)));
|
||||||
|
|
||||||
StatementPrinter statementPrinter = new StatementPrinter();
|
StatementPrinter statementPrinter = new StatementPrinter();
|
||||||
|
|
||||||
|
// Not implemented yet
|
||||||
Assertions.assertThrows(Error.class, () -> {
|
Assertions.assertThrows(Error.class, () -> {
|
||||||
statementPrinter.print(invoice, plays);
|
statementPrinter.print(invoice, plays);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -0,0 +1,5 @@
|
|||||||
|
Statement for BigCo
|
||||||
|
Henry V: $100.00 (53 seats)
|
||||||
|
As You Like It: $100.00 (55 seats)
|
||||||
|
Amount owed is $200.00
|
||||||
|
You earned 48 credits
|
||||||
Reference in New Issue
Block a user