Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

[ControllerUnitTest] Make the controller class not to throw an exception for simple unit tests #1771

Closed
ianhong opened this issue Jan 6, 2015 · 1 comment

Comments

@ianhong
Copy link
Contributor

ianhong commented Jan 6, 2015

This is related to #1504. To make this scenario work, we should update the controller class as follows:

        // Do not override ViewData.Model unless passed a non-null value.
        if (ViewData != null && model != null )
        {
            ViewData.Model = model;
        }

        return new ViewResult()
        {
            ViewName = viewName,
            ViewData = ViewData,
            ViewEngine = _viewEngine,
        };
@ianhong ianhong added the feature label Jan 6, 2015
@ianhong ianhong added this to the 6.0.0-rc1 milestone Jan 6, 2015
@ianhong ianhong self-assigned this Jan 6, 2015
@yishaigalatzer
Copy link
Contributor

Fixed with 2cf56c7

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants