Esempio n. 1
0
        public void ResultLog_Create_Default_Should_Pass()
        {
            // Arrange
            var myController = new ResultLogController();

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

            // Assert
            Assert.IsNotNull(result);
        }
        public void ResultLog_Create_Post_Default_Should_Pass()
        {
            // Arrange
            var myController = new ResultLogController();
            var myData       = new ResultLogModel();

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

            // Reset

            // Assert
            Assert.IsNotNull(result);
        }
        public void ResultLog_Create_Post_Invalid_Model_Should_Send_Back_For_Edit()
        {
            // Arrange
            var controller = new ResultLogController();
            var data       = new ResultLogModel();

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

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

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