Home
Options

Error when running xunit tests, AssemblyRunner.Start() ambiguous method

edited June 19

A recent Linqpad update caused this issue.
Error when executing xunit tests in a query. Simply create a new empty query, add Xunit test support and then run. Error is:

CS0121 The call is ambiguous between the following methods or properties: 'AssemblyRunner.Start(string, bool?, TestMethodDisplay?, TestMethodDisplayOptions?, bool?, bool?, int?, bool?)' and 'AssemblyRunner.Start(string, bool?, TestMethodDisplay?, TestMethodDisplayOptions?, bool?, bool?, int?, bool?, ParallelAlgorithm?)'

Environment:

  • Linqpad v8.4.11 beta
  • Windows 11

The offending line of code in the xunit.linq is:

static TestResultSummary[] RunTests(bool quietly = false, bool reportFailuresOnly = false, Func<Xunit.Abstractions.ITestCase, bool> filter = null)
{
//stuff...
   runner.Start();
   done.Wait();
   return tests;
}

I fixed it with a specific call to the overload accepting the options instance (since the other two overloads are obsolete and complex) Not sure if this is correct but it works:

var opt = new AssemblyRunnerStartOptions();
runner.Start(opt);

Comments

Sign In or Register to comment.