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

Improve Mock support for Viewcontexts #268

Closed
rynowak opened this issue Apr 16, 2014 · 6 comments
Closed

Improve Mock support for Viewcontexts #268

rynowak opened this issue Apr 16, 2014 · 6 comments

Comments

@rynowak
Copy link
Member

rynowak commented Apr 16, 2014

Discovered during filters work. All of our old context classes in MVC had a no-arg constructor + virtual public property accessors for testability. Need to do a pass

@davidfowl davidfowl added this to the Post Alpha milestone Apr 16, 2014
@davidfowl davidfowl added the bug label Apr 16, 2014
@Eilon
Copy link
Member

Eilon commented Apr 17, 2014

BTW this is often for app developer unit tests; though we of course also benefit from this for our own unit tests.

@ianhong
Copy link
Contributor

ianhong commented Feb 3, 2015

ActionContext will be updated per #1934

@danroth27 danroth27 modified the milestones: 6.0.0, 6.0.0-rc1 Mar 16, 2015
@ianhong ianhong changed the title Improve Mock support for various contexts Improve Mock support for Viewcontexts Apr 22, 2015
@ianhong
Copy link
Contributor

ianhong commented Apr 22, 2015

@rynowak and @Eilon

I think I need a little bit more investigation on this. We added the default constructor to ActionContext to improve unit testability of Controllers.
I think we should do this to improve unit-testability of custom HtmlHelpers, TagHelpers, and ViewComponents.
So, I'll start from doing unit tests to them to find out more requirements on this.

I'm wondering if you have any more scenarios to add in addition to HtmlHelpers, TagHelpers, and ViewComponents. ??

@rynowak
Copy link
Member Author

rynowak commented Apr 22, 2015

Seems like a good idea to care about testability for TagHelpers and ViewComponents. Custom HtmlHelper implementations, I'm less convinced.

@Eilon
Copy link
Member

Eilon commented Apr 23, 2015

Yeah let's start out with what @rynowak said.

@ianhong
Copy link
Contributor

ianhong commented May 12, 2015

3ea7daa

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

6 participants