Build/Test Issues

NCrunch doesn't detect new files in subdirectories in test projects

Started by mptorney on 2,458 views

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?)



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.
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.

Edited

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,

Edited

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
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.

Edited

Hi,

I've got a new build available that fixes the problem when I test it. Since this was a timing issue / race condition; would you mind testing the build?

NCrunch_Console_5.4.0.1.msi
NCrunch_Console_5.4.0.1.zip
NCrunch_GridNodeServer_5.4.0.1.msi
NCrunch_GridNodeServer_5.4.0.1.zip
NCrunch_LicenseServer_5.4.0.1.zip
NCrunch_Rider_5.4.0.1.7z
NCrunch_Rider_5.4.0.1.zip
NCrunch_VS2010_5.4.0.1.msi
NCrunch_VS2010_5.4.0.1.zip
NCrunch_VS2012_5.4.0.1.msi
NCrunch_VS2012_5.4.0.1.zip
NCrunch_VS2013_5.4.0.1.msi
NCrunch_VS2013_5.4.0.1.zip
NCrunch_VS2015_5.4.0.1.msi
NCrunch_VS2015_5.4.0.1.msi.7z
NCrunch_VS2015_5.4.0.1.zip
NCrunch_VS2017_5.4.0.1.msi
NCrunch_VS2017_5.4.0.1.msi.7z
NCrunch_VS2017_5.4.0.1.zip
NCrunch_VS2019_5.4.0.1.msi
NCrunch_VS2019_5.4.0.1.msi.7z
NCrunch_VS2019_5.4.0.1.zip
NCrunch_VS2022_5.4.0.1.msi
NCrunch_VS2022_5.4.0.1.msi.7z
NCrunch_VS2022_5.4.0.1.zip

Hi Michael,

I can confirm that this works in my real solution and in the sample solution that I made. Thanks for the help!
Thanks again for the report and testing the build!

Post a reply

Log in to reply.