src/MvcContrib.TestHelper/MvcContrib.TestHelper/FluentController/ViewRender.cs
/// <summary>
/// Asserts that a RenderViewResult is rendering the specified view.
/// </summary>
/// <param name="result">The result to check.</param>
/// <param name="viewName">The name of the view.</param>
/// <returns></returns>
Asserts that a RenderViewResult is rendering the specified view.
Asserts that a RenderViewResult is rendering the specified view .
public static T ForView<T>(this T result, string viewName) where T : ViewResultBase
		{
			if(result.ViewName != viewName)
			{
				throw new ActionResultAssertionException(String.Format("Expected view name '{0}', actual was '{1}'", viewName,
				                                                       result.ViewName));
			}
			return result;
		}
public static T ForView < T > ( this T result , string viewName ) where T : ViewResultBase { if ( result . ViewName != viewName ) { throw new ActionResultAssertionException ( String . Format ( " " , viewName , result . ViewName ) ) ; } return result ; }
Asserts that a RenderViewResult is rendering the specified view.
Asserts that a RenderViewResult is rendering the specified view .
None
T
this
viewName
string
The name of the view.
The name of the view .
result
The result to check.
The result to check .