提交 3cb87280 编写于 作者: I Ilkka Seppälä

Hexagonal pattern: remove unnecessary repository usage from a unit test

上级 ab681298
......@@ -49,20 +49,16 @@ import com.iluwatar.hexagonal.test.LotteryTestUtils;
public class LotteryTest {
private final LotterySystem lotterySystem = new LotterySystemImpl();
private final LotteryTicketRepository repository = new LotteryTicketInMemoryRepository();
private final WireTransfers wireTransfers = new WireTransfersImpl();
@Before
public void clear() {
repository.deleteAll();
// add funds to the test player's bank account
wireTransfers.setFunds("123-12312", 100);
}
@Test
public void testLottery() {
// setup bank account with funds
wireTransfers.setFunds("123-12312", 100);
// admin resets the lottery
lotterySystem.resetLottery();
assertEquals(lotterySystem.getAllSubmittedTickets().size(), 0);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册