Copy file on test run?

Working with a Unity project. Using the Rider nunit runner to test headless code (i.e. can run w/o any Unity dependencies).

Would like to copy a file from the Unity project into the Temp/Bin/Debug folder for access via TestContext.WorkingDirectory.

Best way to accomplish this? Currently have .csproj files excluded from Git.

Thanks!

0
1 comment

To clarify, I'm able to get the behavior by going into the UI and setting the properties for the file to Copy Always.

This appears to add the following to the .csproj file:

<ItemGroup>
<Content Include="Assets\Headless\core.wdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

...but that file isn't checked into Git. Is there a better strategy?

 

1

Please sign in to leave a comment.