use of com.management.fake.FanZoneRepositoryFake in project Internet-Software-Architectures by zivko11.
the class FanZoneControllerTests method AddingNewFanZone_ReturnsOK.
@Test
public void AddingNewFanZone_ReturnsOK() {
// Arrange
Mockery mock = new Mockery();
fanZoneRepository = new FanZoneRepositoryFake();
FanZoneDTO dto = new FanZoneDTO();
dto.setFanZoneName("Spodermna fan zone");
FanZoneManager manager = new FanZoneManager(fanZoneRepository);
FanZoneController controller = new FanZoneController(manager);
// Act and assert
Assert.assertNotNull(controller);
Assert.assertEquals(controller.addFanZone(dto), new ResponseEntity<FanZoneDTO>(dto, HttpStatus.OK));
mock.assertIsSatisfied();
}
use of com.management.fake.FanZoneRepositoryFake in project Internet-Software-Architectures by zivko11.
the class FanZoneManagerTests method AddingNewFanZone_ReturnsBoolean.
@Test
public void AddingNewFanZone_ReturnsBoolean() {
// Arrange
fanZoneRepository = new FanZoneRepositoryFake();
FanZoneDTO dto = new FanZoneDTO();
dto.setFanZoneName("Spoderman Fan Zone");
FanZoneManager manager = new FanZoneManager(fanZoneRepository);
// Act and assert
Assert.assertNotNull(manager);
Assert.assertTrue(manager.Create(dto));
FanZone fz = fanZoneRepository.findOne(0);
Assert.assertEquals(dto.getFanZoneId(), fz.getFanZoneId());
Assert.assertEquals(dto.getFanZoneName(), dto.getFanZoneName());
}
Aggregations