public void TestAuthorize_NotLoggedUser_ShouldReturnException() { var database = new HotelBookingSystemData(); var controller = new VenuesController(database, null); controller.Details(1); }
public async void Details_ContainsCorrectModel() { var expectedResource = VenueGenerator.Create(); Repository.Setup(v => v.GetByIdAsync(1)).ReturnsAsync(expectedResource); var viewResult = await Controller.Details(1) as ViewResult; Assert.IsType <Venue>(viewResult.Model); var resources = viewResult.Model as Venue; Assert.Equal(expectedResource, resources); }
public void Authorize_NoLoggedUser_ShouldThrow() { var controller = new VenuesController(this.data, null); controller.Details(1); }
public void UnAuthorizedUserCannotViewVanuesDetails() { var data = new HotelBookingSystemData(); var controller = new VenuesController(data, null); var view = controller.Details(1); }