public void SetUp() { writer = new StringWriter(); var htmlHelper = MvcTestHelpers.CreateMockHtmlHelper(writer); var entity = new TestEntity {Id = 4}; postAction = new PostAction<TestController>(htmlHelper, c => c.DoSomething(entity), "the button text"); }
public void GetExpressionDetails_should_work() { var entity = new TestEntity { Id = 4 }; Expression<Action<TestController>> action = c => c.DoSomething(entity); var expressionDetails = PostAction<TestController>.GetExpressionDetails(action); expressionDetails.MethodName.ShouldEqual("DoSomething"); expressionDetails.IdValue.ShouldEqual(4); }
public ActionResult DoSomething(TestEntity entity) { return(null); }
public ActionResult DoSomething(TestEntity entity) { return null; }