Reputation: 23224
https://github.com/mrpmorris/AutoRegister (deleted-tests branch)
My unit tests project has a project reference to Morris.AutoRegister.Fody
. When I run the tests in Visual Studio they work fine, but when I run them via dotnet test
in the Source
folder I get the following error for every test...
C:\Data\Mine\Code\AutoRegister\Source\Lib\Morris.AutoRegisterTests\ModuleWeaverTests\AutoRegisterAttributeTests\FindTests\ServiceTypeFilterTests.cs(31): error test failed:
WhenAServiceTypeFilterIsSpecified_ThenOnlyServiceTypesMatchingThatFilterAreRegistered (1ms): Test method Morris.Au
toRegisterTests.ModuleWeaverTests.AutoRegisterAttributeTests.FindTests.ServiceTypeFilterTests.WhenAServiceTypeFilt
erIsSpecified_ThenOnlyServiceTypesMatchingThatFilterAreRegistered threw exception:
System.IO.FileNotFoundException: Could not load file or assembly 'Morris.AutoRegister.Fody, Version=1.0.0.0, Cultu
re=neutral, PublicKeyToken=null'. The system cannot find the file specified.
Stack Trace:
at Morris.AutoRegisterTests.ModuleWeaverTests.WeaverExecutor.Execute(String sourceCode, TestResult& testResult
, String& manifest, Boolean assertNoDiagnosticsOutput, String partialMethodsSourceCode)
at Morris.AutoRegisterTests.ModuleWeaverTests.AutoRegisterAttributeTests.FindTests.ServiceTypeFilterTests.WhenA
ServiceTypeFilterIsSpecified_ThenOnlyServiceTypesMatchingThatFilterAreRegistered() in C:\Data\Mine\Code\AutoRegist
er\Source\Lib\Morris.AutoRegisterTests\ModuleWeaverTests\AutoRegisterAttributeTests\FindTests\ServiceTypeFilterTes
ts.cs:line 31
at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructo
r)
at System.Reflection.MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)
UPDATE
dotnet test --no-build
then the test runs and passes.dotnet test --no-restore
then it rebuilds and still works.dotnet test
it restores + rebuilds and then fails.Upvotes: 2
Views: 53