public async void Details_ReturnsAViewResult() { //Arrange EventTypesController eventtypescontroller = new EventTypesController(context); //Act var result = await eventtypescontroller.Details(1); //Assert Assert.IsType <ViewResult>(result); }
public async void Details_ReturnsANotFoundResult(int?eventtyperId) { //Arrange EventTypesController eventtypescontroller = new EventTypesController(context); //Act var result = await eventtypescontroller.Details(eventtyperId); //Assert Assert.IsType <NotFoundResult>(result); }
public async Task Details_ReturnsViewResultWithEventTypeModel() { //Arrange var dbContext = await GetDatabaseContext(); var eventTypesController = new EventTypesController(dbContext); //Act var result = await eventTypesController.Details(11); //Assert var viewResult = Assert.IsType <ViewResult>(result); var model = Assert.IsType <EventType>( viewResult.ViewData.Model); Assert.Equal(11, model.EventTypeID); Assert.Equal("Sport", model.Type); }