예제 #1
0
        public async void Details_ReturnsAViewResult()
        {
            //Arrange
            EventTypesController eventtypescontroller = new EventTypesController(context);

            //Act
            var result = await eventtypescontroller.Details(1);

            //Assert
            Assert.IsType <ViewResult>(result);
        }
예제 #2
0
        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);
        }
예제 #3
0
        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);
        }