use of com.management.fake.CinemaTheatreRepositoryFake in project Internet-Software-Architectures by zivko11.
the class CinemaTheatreManagerTests method AddingNewCinemaTheatre_ReturnsBoolean.
@Test
public void AddingNewCinemaTheatre_ReturnsBoolean() {
// Arrange
cinemaTheatreRepository = new CinemaTheatreRepositoryFake();
CinemaTheatreDTO dto = new CinemaTheatreDTO();
dto.setCtAdress("Bulevar oslobodjenja 11");
dto.setCtDescription("Ovo je opis.");
dto.setCtName("Bioskop");
dto.setCtPhone(1234567890);
CinemaTheatreManager manager = new CinemaTheatreManager(cinemaTheatreRepository);
// Act and assert
Assert.assertNotNull(manager);
Assert.assertTrue(manager.Create(dto));
CinemaTheatre cinemaTheatre = cinemaTheatreRepository.findOne(0);
Assert.assertEquals(dto.getCtAdress(), cinemaTheatre.getCtAdress());
Assert.assertEquals(dto.getCtDescription(), cinemaTheatre.getCtDescription());
Assert.assertEquals(dto.getCtName(), cinemaTheatre.getCtName());
Assert.assertEquals(dto.getCtPhone(), cinemaTheatre.getCtPhone());
}
use of com.management.fake.CinemaTheatreRepositoryFake in project Internet-Software-Architectures by zivko11.
the class CinemaTheatreControllerTests method AddingNewCinemaTheatre_ReturnsOK.
@Test
public void AddingNewCinemaTheatre_ReturnsOK() {
// Arrange
cinemaTheatreRepository = new CinemaTheatreRepositoryFake();
CinemaTheatreDTO dto = new CinemaTheatreDTO();
dto.setCtAdress("Bulevar oslobodjenja 11");
dto.setCtDescription("Ovo je opis.");
dto.setCtName("Bioskop");
dto.setCtPhone(1234567890);
CinemaTheatreManager manager = new CinemaTheatreManager(cinemaTheatreRepository);
CinemaTheatreController controller = new CinemaTheatreController(manager);
// Act and assert
Assert.assertNotNull(controller);
Assert.assertEquals(controller.addCinemaTheatre(dto), new ResponseEntity<CinemaTheatreDTO>(dto, HttpStatus.OK));
}
Aggregations