asp.net mvc - stymied by attack hampsters trying to unit test a method that returns an action result -
OK - so I started this way,
public view recommended index ( ) {See Return (service.GetProjects ()); } And this is my test I
[TestMethod] Public Zero index_th_th_a_list_off_activ_prejex () {var view = controller.Index (); Confirm. Erequal (see ViewData.ModelGetType (), Typef (List & Project & gt;)); } All who bend with Dokken but then I added a login and if the user is not authenticated then I redirect them to the login page. Here's what the new method looks like Public Performance Index () {If (Request .asA certified) see return (service.GetProjects ()); Return Redirect Action ("Login", "Account"); } My problem is this - I do not know how to determine the unit test for my life, I can not return any visual result any longer, so I can see the .ViewData.Model property But I can not understand how the redirect is still done while returning to the audience. I was trolling the site and I found this, but that does not really help.
If someone can tell me what will be the rule here - I am stumped.
I will remove that argument from your action and instead use it. Then your test does not change and you can create a separate test that emphasizes that the attribute is being decorated by attribute.
[Authorized] Public Visible Index () {See (service.GetProjects ()); }
Comments
Post a Comment