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

Notification

Icon
Error

NCrunch doesn't detect new files in subdirectories in test projects
mptorney
#1 Posted : Friday, March 8, 2024 10:06:14 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/15/2012(UTC)
Posts: 6
Location: United Kingdom

Was thanked: 5 time(s) in 5 post(s)
Hi,

I'm using NCrunch 5.1 with Rider.

I have a test project that contains subdirectories to organise the tests. When I create a new class in a subdirectory via right-clicking the project in the solution tree node, everything is fine. However, if I create my new class in an existing class and then ask Rider to move the new class to its own file, NCrunch does not detect that the new file exists. If I reference the new class, I get a build error in NCrunch.

1: Add a class "A" to an existing file that is inside a subdirectory:
[TestFixture]
public class Test
{
[Test]
public void TestA()
{

}
}

public class A
{

}

2: Ask Rider to move A to a new file.
3: Reference A in Test causes a build error in NCrunch:
Project\Test.cs (11, 17): The type or namespace name 'A' could not be found (are you missing a using directive or an assembly reference?)



1 user thanked mptorney for this useful post.
michaelkroes on 3/8/2024(UTC)
michaelkroes
#2 Posted : Friday, March 8, 2024 10:18:36 AM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Hi,

Thanks for testing and using our NCrunch under Rider and reporting the feedback!

I use this method of creating new files a lot myself. I just tested it and I can't get it to fail on my end. I've tried both alt+enter and ctrl+shift+r to move the class to a different file. I also tried the root of the project and a subdirectory. Both worked for me.

Can you tell me what method you use to move the class to it's own file?

Would you mind using the contact form to send us the idea.log and all the backend log files? Those can be found by going to the Rider Help menu -> Diagnostic Tools -> Show log in Explorer.
mptorney
#3 Posted : Friday, March 8, 2024 10:28:04 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/15/2012(UTC)
Posts: 6
Location: United Kingdom

Was thanked: 5 time(s) in 5 post(s)
Hi Michael,

I use Alt + Enter then Enter again to move the file.

The solution I'm using is quite large, with ~150 projects. I'll try to recreate this with a sample project.
1 user thanked mptorney for this useful post.
michaelkroes on 3/8/2024(UTC)
mptorney
#4 Posted : Friday, March 8, 2024 11:27:06 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/15/2012(UTC)
Posts: 6
Location: United Kingdom

Was thanked: 5 time(s) in 5 post(s)
Hi Michael,

The same thing happens with a new solution for me. I've uploaded a solution and a video to one drive:

Solution And Video

Thanks,
1 user thanked mptorney for this useful post.
michaelkroes on 3/8/2024(UTC)
michaelkroes
#5 Posted : Friday, March 8, 2024 11:37:16 AM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Hi Martin,

Thanks for the video. I did have the same workflow, so that's not it. But the sample solution does give me the same behavior. My current suspicion is either the project type or the target framework. I'll look into fixing this, thanks for the help and I'll let you know when a fix is available.

Michael
mptorney
#6 Posted : Friday, March 8, 2024 11:49:46 AM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/15/2012(UTC)
Posts: 6
Location: United Kingdom

Was thanked: 5 time(s) in 5 post(s)
Hi Michael,

Thanks for looking into it. Adding classes from the solution treeview is a decent enough workaround, so this isn't urgent at all.
1 user thanked mptorney for this useful post.
michaelkroes on 3/8/2024(UTC)
michaelkroes
#7 Posted : Wednesday, March 13, 2024 7:17:33 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
mptorney
#8 Posted : Wednesday, March 13, 2024 8:24:09 PM(UTC)
Rank: Newbie

Groups: Registered
Joined: 10/15/2012(UTC)
Posts: 6
Location: United Kingdom

Was thanked: 5 time(s) in 5 post(s)
Hi Michael,

I can confirm that this works in my real solution and in the sample solution that I made. Thanks for the help!
1 user thanked mptorney for this useful post.
michaelkroes on 3/14/2024(UTC)
michaelkroes
#9 Posted : Thursday, March 14, 2024 5:30:14 PM(UTC)
Rank: NCrunch Developer

Groups: Registered
Joined: 9/22/2017(UTC)
Posts: 306
Location: Netherlands

Thanks: 138 times
Was thanked: 73 time(s) in 69 post(s)
Thanks again for the report and testing the build!
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.097 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download