src/MvcContrib.TestHelper/MvcContrib.TestHelper/FluentController/ActionExpectations.cs
/// <summary>
/// Whens the calling.  This returns void as it should be the last action in a chain of commands.
/// 
/// <example>
/// <code>
///    [TestClass]
///    public class UserControllerRedirectsTest
///    {
///        [TestMethod]
///        public void SuccessfulCreateRedirectsToIndex()
///        {
///            GivenController.As&lt;UserController>()
///                .ShouldRedirectTo("Index")
///                .IfCallSucceeds()
///                .WhenCalling(x => x.Create(null));
///        }
///
///        [TestMethod]
///        public void UnsuccessfulCreateDisplaysNew()
///        {
///            GivenController.As&lt;UserController>()
///                .ShouldRenderView("New")
///                .IfCallFails()
///                .WhenCalling(x => x.Create(null));
///        }
///
///        [TestMethod]
///        public void NewReturnsItself()
///        {
///            GivenController.As&lt;UserController>()
///                .ShouldRenderItself("New")
///                .WhenCalling(x => x.New());
///        }
/// </code>
/// </example>
/// </summary>
/// <param name="action">The action.</param>
Whens the calling.  This returns void as it should be the last action in a chain of commands.






Whens the calling . This returns void as it should be the last action in a chain of commands .
public void WhenCalling(Func<T, ActionResult> action)
		{
			ActionResult actionResult = action((T)MockController);
			Expectations.ForEach(x => x(actionResult));
			MockController.VerifyAllExpectations();
		}
public void WhenCalling ( Func < T , ActionResult > action ) { ActionResult actionResult = action ( ( T ) MockController ) ; Expectations . ForEach ( x => x ( actionResult ) ) ; MockController . VerifyAllExpectations ( ) ; }
Whens the calling.
Whens the calling .
action
Func<T, ActionResult>
None