Exemple #1
0
        public void PopulateDropdown_SendNull_ReturnListOfSelectListItems()
        {
            // Arrange
            ServiceListingsController controller = new ServiceListingsController(context);

            // Act
            var list = controller.PopulateDropdown(null);

            // Assert
            Assert.True(list.Count > 0);
        }
Exemple #2
0
        public async Task FilterServices_SendNullData_ReturnRedirect()
        {
            // Arrange
            ServiceListingsController controller = new ServiceListingsController(context);

            // Act
            var actionResult = await controller.FilterServices(null);

            // Assert
            Assert.IsType <ViewResult>(actionResult);
        }
Exemple #3
0
        public void Details_PassInNull_ReturnNotFound()
        {
            // Arrange
            ServiceListingsController controller = new ServiceListingsController(context);

            // Act
            var actionResult = controller.Details(null);

            // Assert
            Assert.IsType <NotFoundResult>(actionResult.Result);
        }
Exemple #4
0
        public async Task FilterServices_SendViableValues_ReturnView()
        {
            // Arrange
            ServiceListingsController controller = new ServiceListingsController(context);

            // Act
            var actionResult = await controller.FilterServices("Hello");

            // Assert
            Assert.IsType <ViewResult>(actionResult);
        }
Exemple #5
0
        public async void Index_CallFunction_ReturnView()
        {
            // Arrange
            ServiceListingsController controller = new ServiceListingsController(context);

            // Act
            var actionResult = await controller.Index();

            // Assert
            Assert.IsType <ViewResult>(actionResult);
        }