Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Is it possible to list tests in code order, in the test window
AlexV
#1 Posted : Thursday, October 22, 2020 9:06:33 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/22/2020(UTC)
Posts: 4
Location: Portugal

Was thanked: 1 time(s) in 1 post(s)
By clicking on the Name column I can toggle between alphabetical, reverse alphabetical, and some unknown third state. Is there any way to get it to list the tests in their natural order, though, how they appear in my source code?
Remco
#2 Posted : Thursday, October 22, 2020 11:28:51 AM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Hi, thanks for posting.

At the moment, it isn't possible to do this. Could you elaborate on why you'd like to do it?
AlexV
#3 Posted : Thursday, October 22, 2020 11:43:17 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/22/2020(UTC)
Posts: 4
Location: Portugal

Was thanked: 1 time(s) in 1 post(s)
Oh, that's a shame. Sure, I'll elaborate.

When I'm going through a fixture full of tests that have gone red, I typically start at the top of my file and work my way down. If I want to check the trace output, or run the test under debugger, or in any way interact with the test in the test window, I naturally click on the test at the top of the list, expecting it to match the test at the top of the file. Even though I know it isn't, I still keep getting tripped up by this. Then I have to search through the list trying to find the right test to select, where often the relevant bit of the test name is at the end of the name and is clipped by the column width. Makes it quite inconvenient.

Also, tests are often (very) loosely grouped together by position in the file. If it's not a strong enough relationship to be worth creating a new fixture for (and breaking the one fixture per class under test convention) then I might have, for example TestAddPerson, TestDeletePerson, TestUpdatePerson method all next to each other, then some other non-Person related tests too.

There's workarounds, I guess, I could rename my tests, or avoid using the test window and use the in-editor popup (for some stuff, other's like the trace output can't be had here), but I find the in-editor UI significantly less convenient than the test window. I think because it's a small target to hit, then a context menu and a new visual search for the UI element to hit and moving the mouse again. Compared to, once the test is selected in the test window, just a single click on the toolbar button that is always in the same place. Really minor stuff, but I think that's why I find it more 'expensive' using the in-editor UI to the test window.
AlexV
#4 Posted : Thursday, October 22, 2020 1:17:16 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/22/2020(UTC)
Posts: 4
Location: Portugal

Was thanked: 1 time(s) in 1 post(s)
Oh, one thing I should probably have mentioned, I start from the top and work down not just out of habit, but because of the way tests are written code-order is usually a good analogue for increasing complexity and dependency. For example, in a fixture there might be:

TestStoreAndRetrieve
TestMultipleRetrievesAreCached
TestSimultaneousMultiThreadedRetrieve
TestQueuedMultiThreadedStore

And so on. The point is, if TestStoreAndRetrieve is red then there's no point in even investigating failures of later tests until that one is resolved. There's not necessarily a strict dependency or anything, it's just that when you're writing the tests we tend to start with the simpler cases and write more complex ones after being confident of the basic behaviour.
Remco
#5 Posted : Thursday, October 22, 2020 11:55:36 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,123

Thanks: 957 times
Was thanked: 1286 time(s) in 1193 post(s)
Thanks, this makes sense. Could I interest you in adding this as a feature request on uservoice? This will allow us to track it and implement it if it's popular enough.
AlexV
#6 Posted : Friday, October 23, 2020 7:55:56 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/22/2020(UTC)
Posts: 4
Location: Portugal

Was thanked: 1 time(s) in 1 post(s)
Feature Request created, thanks.
1 user thanked AlexV for this useful post.
Remco on 10/23/2020(UTC)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.039 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download