开发者

Should I use the DotNetOpenAuth OpenIdRelyingParty RedirectingResponse.AsActionResult or RedirectToProvider in MVC?

I've implemented an OpenID controller using Dnoa. I was using the approach found in the RP MVC template for dnoa, which returns IAuthenticationRequest.RedirectingResponse.AsActionResult() from the controller action. However, I've now found the controller very difficult to test using Moq because of this method.

I changed the controller to instead invoke IAuthenticationRequest.RedirectToProvider() and return null for the Actio开发者_JS百科nResult, which seems to have the same effect. RedirectToProvider should be easier to mock, but is it appropriate to return null from the controller in this case?


The AsActionResult method is meant for MVC, obviously. I would encourage you to use it.

Can you tell me why it's difficult to test?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜