use of com.management.fake.SeatRepositoryFake in project Internet-Software-Architectures by zivko11.
the class SeatManagerTests method AddingNewSeat_ReturnsBoolean.
@Test
public void AddingNewSeat_ReturnsBoolean() {
// Arrange
seatRepository = new SeatRepositoryFake();
SeatDTO dto = new SeatDTO();
dto.setSeatModified(new Date());
dto.setSeatTaken(true);
SeatManager manager = new SeatManager(seatRepository);
// Act and assert
Assert.assertNotNull(manager);
Assert.assertTrue(manager.Create(dto));
Seat seat = seatRepository.findOne(0);
Assert.assertEquals(dto.getSeatId(), seat.getSeatId());
Assert.assertEquals(dto.getSeatModified(), seat.getSeatModified());
Assert.assertEquals(dto.isSeatTaken(), seat.isSeatTaken());
}
use of com.management.fake.SeatRepositoryFake in project Internet-Software-Architectures by zivko11.
the class SeatControllerTests method AddingNewSeat_ReturnsOK.
@Test
public void AddingNewSeat_ReturnsOK() {
// Arrange
seatRepository = new SeatRepositoryFake();
SeatDTO dto = new SeatDTO();
dto.setSeatModified(new Date());
dto.setSeatTaken(true);
SeatManager manager = new SeatManager(seatRepository);
SeatController controller = new SeatController(manager);
// Act and assert
Assert.assertNotNull(controller);
Assert.assertEquals(controller.addSeat(dto), new ResponseEntity<SeatDTO>(dto, HttpStatus.OK));
}
Aggregations