public void ResultData_Create_Default_Should_Pass()
        {
            // Arrange
            var myController = new ResultDataController();

            // Act
            var result = myController.Create();

            // Assert
            Assert.IsNotNull(result);
        }
Exemple #2
0
        public void ResultData_Create_Post_Default_Should_Pass()
        {
            // Arrange
            var myController = new ResultDataController();
            var myData       = new ResultDataModel();

            // Act
            var result = myController.Create(myData);

            // Reset

            // Assert
            Assert.IsNotNull(result);
        }
Exemple #3
0
        public void ResultData_Create_Post_Invalid_Model_Should_Send_Back_For_Edit()
        {
            // Arrange
            var controller = new ResultDataController();
            var data       = new ResultDataModel();

            // Make ModelState Invalid
            controller.ModelState.AddModelError("test", "test");

            // Act
            var result = controller.Create(data) as RedirectToActionResult;

            // Assert
            Assert.AreEqual("Error", result.ActionName);
        }