-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V4 menu test #1
V4 menu test #1
Conversation
That is a good question, and I wish I had a good answer. I would say that if you find something that is obviously wrong, to make it return the result you think it should. Clearly, if a combination is returning nothing there is probably something wrong if there are nodes defined that should be shown that aren't. So, what state are you in currently? Is this acting exactly like v3, or have you also attempted to fixed the bugs you observed in the v3 behavior? |
There's a scenario make the menu be duplicated. (Fixed)
Of course, I'm finding the differences between them. But there're many methods, and so many scenarios was given from them. I think I would done the first task before caring about the bugs in the v3 that I don't know if it exists or not. It might be someone else think it is correct. |
Ok, so if you can get the menu working the same as v3, that is fine. It is also the logical first step if you would like to go further and fix some of the other issues. Note that the 21 overloads that exist in v3 are really all you need to worry about, and I would focus on the options (startingNode, startingNodeInChildLevel, showStartingNode, maxDepth, drillDownToCurrent). That is a lot, which is why I suggested unit tests so you can run through a large number of use cases in a few seconds rather than going through them all manually. I am not that comfortable writing tests either, but I can see they clearly have an advantage in this case to manual testing. FYI - Maarten and I have agreed to make v4 official on Monday. However, we could postpone the release to give people a chance to test out this menu with the fixes you are putting in. Another thing to be aware of is that we have already discussed creating a new menu in a future 4.x release. The 3.x menu apparently didn't get a lot of adaption, presumably because its options are confusing and it has bugs. That is probably why only 2 people complained about the menu after more than 150 downloads. Discussion of the new menu can be found in maartenba#125 and maartenba#160. |
Add more testcase by modifying TestModels
I don't know how to write unit tests for MVC Web. |
Merged it in. We still need to find a way around the unit tests though. |
The latest build on Nuget has your changes. Note we had to leave out the commit for upgrading Nuget packages because we need to support legacy versions of some packages in order to support .NET 3.5. |
Sorry, I'm not used to writing unit tests. I fixed the code by observing the changes of menu(v3) with distinct arguments was passed. While I was doing so, I noticed that the menu(v3) didn't act as it should.
While
@Html.MvcSiteMap().Menu(0, false, true, 2)
return:Then this
@Html.MvcSiteMap().Menu(1, false, true, 2)
should return:But it return nothing instead.
I can make v4 menu act like v3 menu, but how do I know if the v3 menu is correct or not.