asp.net mvc - Why are my Outbound URLs in NUnit different from the ones in my View? -


I am reading the ASP.NET MVC framework book. For example, on the 106 - 111, the author walks through creating a NUnit test for an HTMLHelper class.

I have noticed that when I ran my HTMLHelper code in NUnit, the link appeared like this:

  & lt; A href = "Page1" & gt; 1 & lt; / A & gt; & Lt; One class = "selected" href = "page 2" & gt; 2 & lt; / A & gt; & Lt; A href = "page 3" & gt; 3 & lt; / A & gt;  

But when I look at them in the view they look like this:

     

; Routes Marker (tap, "", new {controller = "product", action = "list", page = 1}); Routes.MapRoute (tap, "page {page}", new {controller = "product", verb = "list"}, new {page = @ "\ d +"}); Public String String Page Link (This HTMLHTML, HTML, Int, Current Pages, Int Total Page, Funk & Lieutenant; int, string> pageUrl) {stringbilder result = new stringbilder (); (Int i = 1; i

See the code

  & lt;% = HTML.PageLinks (2,3, i = & gt; Url .Action ("list", new {page = i}))%>  

test code

  string link = ((HtmlHelper faucet) .page link (2, 3, i = & Gt; "Page" + i); Estrel Eraqual (@ "& lt; a href =" "Page 1"> 1    

I understand: The URL is built on the basis of information in my routing table, so I am not sure why the link will be different. Is not the same view of NUnit which makes the visual and thus creates different links? To generate the same exact link to the view I'm NUnit Do you get Ase?


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -