Slide 40
Slide 40 text
Protect
Just call the function
Approval tests to assert the full text
String result = receiptService.makeReceipt(panier, catalog, new TextPrinter());
String expectedOutput =
" JP Gothié créations, Paris \n" +
"-----------------------\n" +
" chemise deluxe 199.99 €\n" +
" veste frimeur 520.50 €\n" +
" chaussures cuir croco® 410.00 €\n" +
"\n" +
"Total: 1035.92 TTC\n" +
"TVA: 172.65 \n" +
"-----------------------\n" +
" JP Gothié vous remercie pour votre visite";
assertThat(result).isEqualTo(expectedOutput);
String result = receiptService.makeReceipt(panier, catalog, new TextPrinter());
Approvals.verify(result);