C[O]RRECT: [O]rdering

Learn the importance of ordering in writing unit tests.

We'll cover the following

[O]rdering

The order of data, or the position of one piece of data within a larger collection, represents a commonly missed piece of the CORRECTness acronym.

Let’s look at an instance where we need ordering in the iloveyouboss application. One of the application’s core features is to score a list of companies based on how well they match the criteria. Naturally, we always want to see the best match first, followed by the second-best, and so on.

The answersResultsInScoredOrder test represents the ordering need:

Get hands-on with 1200+ tech skills courses.