I have the following test which is failing:
[TestCase]
public void Should_order_numeric_suffix()
{
var names = new List<string>
{
"Buisness Unit 7",
"Business Unit 1",
"Buisness Unit 3",
"Business Unit 6",
"Business Unit 4",
"Buisness Unit 2",
"Business Unit 5"
};
List<string> ordered = names.OrderBy(x => x).ToList();
Assert.That(ordered[0], Is.EqualTo("Business Unit 1"));
}
The actual order of the ordered List is:
Business Unit 2
Business Unit 3
Business Unit 7
Business Unit 1
Business Unit 4
Business Unit 5
Business Unit 6
Obviously it is ordering alphabetically correctly but I expected the numeric suffix to be ordered also.
You have typos in your list, some entries spell "Buisness" instead of "Business"... and "Buisness" comes before "Business" in alphabetical order
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With