Reputation: 2057
I'm trying to unit test an Azure Functions project, but I ran into this issue : as soon as I install the Microsoft.NET.Sdk.Functions NuGet package, output directory for the DLL is changed to a sub /bin dir and xUnit runner is unable to find the test DLLs anymore.
Here are the steps to reproduce :
Assert.True(true);
in the created unit test,From what I get from logs is that the build output directory is changed from
$(SourceDirectory)\xUnitTests\xUnitTests\bin\Debug\netcoreapp3.1\
to
$(SourceDirectory)\xUnitTests\xUnitTests\bin\Debug\netcoreapp3.1\bin\
So xUnit.runner.visualstudio
doesn't find the xUnitTests.dll
as it continues to look after it in the first directory and not in the new .\bin one...
Anybody has an explanation, solution or work around ? (except copying the whole directory to the expected location with an after build event)
Thank you for you help and your time.
Upvotes: 0
Views: 543
Reputation: 4199
Now add the Microsoft.NET.Sdk.Functions NuGet package and run the test
AFAIK, you should not add the Microsoft.NET.Sdk.Functions
package to your xUnit
project. Instead, follow the below steps.
xUnit
test project.Resources :
Upvotes: 2