Last active
November 7, 2015 16:00
-
-
Save deap82/11279e2903fb7c7d3b5d to your computer and use it in GitHub Desktop.
Testing Controller actions that calls Url.Action with SpecsFor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Twitter conversation: https://twitter.com/Deap82/status/660723939602247680 | |
| //I got it working by using this in Given, but it seemed strange to me that | |
| //FakeUrlHelper would not be part of it... | |
| protected override void Given() | |
| { | |
| base.Given(); | |
| this.UseFakeContextForController(); | |
| SUT.Url = new UrlHelper(SUT.ControllerContext.RequestContext); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment