Create() public method

public Create ( ) : System.Web.Mvc.ActionResult
return System.Web.Mvc.ActionResult
Ejemplo n.º 1
0
        public void TestCreateReturnView()
        {
            testController = new RuleController(mockRuleService.Object);
            ViewResult result = testController.Create() as ViewResult;

            Assert.IsNotNull(result, "No View was returned.");
            Assert.AreEqual("Create", result.ViewName);
        }
Ejemplo n.º 2
0
        public void TestCreateRule()
        {
            mockRuleService.Setup(rules => rules.Create(mockRuleSets[0])).
                Returns(mockRuleSets[1]).Verifiable();

            testController = new RuleController(mockRuleService.Object);
            RedirectToRouteResult result = testController
                .Create(testRuleDetailsOne) as RedirectToRouteResult;

            Assert.IsNotNull(result, "No RedirectResult thingy was returned.");
            mockRuleService.Verify();
        }