use of com.management.repositories.HallRepository in project Internet-Software-Architectures by zivko11.
the class HallManagerTests method ReadHall_ReturnsHall.
@Test
public void ReadHall_ReturnsHall() {
// Arrange
Mockery mock = new Mockery();
hallRepository = mock.mock(HallRepository.class);
final Hall hall = new Hall();
hall.setHallName("A1");
mock.checking(new Expectations() {
{
oneOf(hallRepository).findOne(1);
will(returnValue(hall));
}
});
HallManager manager = new HallManager(hallRepository);
// Act
HallDTO dto = manager.Read(1);
// Assert
Assert.assertNotNull(dto);
Assert.assertEquals(dto.getHallId(), hall.getHallId());
Assert.assertEquals(dto.getHallName(), hall.getHallName());
mock.assertIsSatisfied();
}
Aggregations