NancyFx/Nancy — pull request #1150 by marcusoftnet (2013-07-12 20:42:19+00:00)
Title: Added tests to prove long lists, with a strange fail for padded zeros

I've added two tests in this PR; one that shows how it works now and one that shows, what I think, should work too.

Should_bind_more_than_10_multiple_Form_properties_to_list binds fine but you need to have the first element be "IntProperty_0". Note that in order to get 10 and above to work 1-9 needs to be padded with zeros (01, 02 .. 09).

But not the first element... So I added the next test:
Should_bind_more_than_10_multiple_Form_properties_to_list_should_work_with_padded_zeros doesn't work since the first element is "IntProperty_00", which is think is strange. We should probably allow for padding of zero even for the first element.

I gave the problem about 20 minutes of my VERY rusty LINQ-fu but couldn't get it to work. I think the problem is in DeafultBinder.GetBindingListInstanceCount on the line that says: var orderedFormParam = matches.OrderByDescending(y => y).First();

That rows fails to sort the array properly. But for the life of me (or well 20 minutes at least) I couldn't get it to work.