Testing TempData Modules in ASP.NET MVC3

How to transfer the following class to ASP.NET MVC3? This is part of MVC: Module controller actions that use the ASP.NET MVC2-based TempData article. The RenderView () method no longer exists and has different parameters.

Thank.

// Test-specific subclass for HomeController. This won't be
// needed in the next release of ASP.NET MVC.
private sealed class TestHomeController : HomeController {
    public RouteValueDictionary RedirectValues;
    public string RenderViewName;
    public string RenderMasterName;
    public object RenderViewData;

    protected override void RedirectToAction(RouteValueDictionary values) {
        RedirectValues = values;
    }

    protected override void RenderView(string viewName, string masterName,
        object viewData) {
        RenderViewName = viewName;
        RenderMasterName = masterName;
        RenderViewData = viewData;
    }
}
+5
source share
1 answer

I finally found this interesting article on how to test TempData in ASP.NET MVC 3: https://web.archive.org/web/20150419085935/http://www.arrangeactassert.com/how-to-unit -test-asp-net-mvc-controllers /

0
source

All Articles