Skip to content

Xunit3 integration does not like xunit.v3.assert.source package reference #909

@sensslen

Description

@sensslen

Reqnroll Version

3.2.0

Which test runner are you using?

xUnit 3

Test Runner Version Number

3.1.0

.NET Implementation

.NET 9.0

Test Execution Method

Visual Studio Test Explorer

Content of reqnroll.json configuration file

I don't know where this file would be located - I don't see it anywhere in the project

Issue Description

When using xunit.v3.assert.source lined to a referenced project a failure in the test pipeline reports

  Message: 
    System.IO.FileNotFoundException : Could not load file or assembly 'xunit.v3.assert, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c'. The system cannot find the file specified.

  Stack Trace: 
    XUnit3RuntimeProvider.DetectExecutionStatus(Exception exception)
    TestExecutionEngine.GetStatusFromException(Exception exception)
    <<ExecuteStepAsync>g__HandleStepExecutionExceptions|0>d.MoveNext()
    --- End of stack trace from previous location ---
    TestExecutionEngine.ExecuteStepAsync(IContextManager contextManager, StepInstance stepInstance)
    TestExecutionEngine.StepAsync(StepDefinitionKeyword stepDefinitionKeyword, String keyword, String text, String multilineTextArg, Table tableArg)
    TestRunner.GivenAsync(String text, String multilineTextArg, Table tableArg, String keyword)
    LibraryPlaylistFeature.ANon_PCOItemCanBeRemovedFromAPCOPlaylist() line 5
    --- End of stack trace from previous location ---

instead of

  Message: 
    Reqnroll.BoDi.ObjectContainerException : Interface cannot be resolved: ProPresenter.DO.Settings.IApp

  Stack Trace: 
    <>c__DisplayClass3_0.<ResolvePerContext>b__1()
    RegistrationWithStrategy.ExecuteWithLock(Object lockObject, Func`1 getter, Func`1 factory, ResolutionList resolutionPath, TimeSpan timeout)
    TypeRegistration.ResolvePerContext(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
    RegistrationWithStrategy.Resolve(ObjectContainer container, RegistrationKey keyToResolve, ResolutionList resolutionPath)
    ObjectContainer.ResolveObject(RegistrationKey keyToResolve, ResolutionList resolutionPath)
    ObjectContainer.Resolve(Type typeToResolve, ResolutionList resolutionPath, String name)
    ObjectContainer.Resolve(Type typeToResolve, String name)
    ObjectContainer.Resolve[T](String name)
    ObjectContainer.Resolve[T]()
    MacroGroupCollectionSupport.InitializeEnvironment() line 30
    <5 more frames...>
    TestExecutionEngine.InvokeHookAsync(IAsyncBindingInvoker invoker, IHookBinding hookBinding, HookType hookType)
    TestExecutionEngine.FireEventsAsync(HookType hookType)
    TestExecutionEngine.FireEventsAsync(HookType hookType)
    TestExecutionEngine.FireScenarioEventsAsync(HookType bindingEvent)
    TestExecutionEngine.OnScenarioStartAsync()
    TestExecutionEngine.OnAfterLastStepAsync()
    TestRunner.CollectScenarioErrorsAsync()
    LibraryPlaylistFeature.ScenarioCleanupAsync()
    LibraryPlaylistFeature.ANon_PCOItemCanBeRemovedFromAPCOPlaylist() line 10
    --- End of stack trace from previous location ---

Steps to Reproduce

  • Have a Reqnroll project configured to use xunit3
  • Make sure you have a second project that references xunit.v3.assert.source
  • Reference the second project from the test project
  • Make sure to reference xunit.v3.core instead of xunit.v3 in the test project
  • Make sure to use BoDi for dependency injection
  • Have at least one dependency missing

Now the error message gets increadibly unhelpful

Link to Repro Project

does not exist - yet

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions