question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Trouble with xUnit.net 2.2.0

See original GitHub issue

I can’t figure out if I’m doing something wrong, but I’m having trouble getting FsCheck.Xunit working with xUnit.net 2.2.0.

I’ve created a simple repro code base with a single test module:

module Properties

open FsCheck
open FsCheck.Xunit
open Swensen.Unquote

[<Property>]
let myProperty (NonNegativeInt x) = 0 <=! x

[<Property>]
let myGenProperty () =
    Arb.generate |> Gen.map ((*) 2) |> Arb.fromGen |> Prop.forAll <| fun i ->
        0 =! i % 2

With xUnit.net 2.1.0 it works fine:

$ packages/xunit.runner.console.2.2.0/tools/xunit.console.exe MyProperty/bin/Debug/MyProperty.dll
xUnit.net Console Runner (64-bit .NET 4.0.30319.42000)
  Discovering: MyProperty
  Discovered:  MyProperty
  Starting:    MyProperty
  Finished:    MyProperty
=== TEST EXECUTION SUMMARY ===
   MyProperty  Total: 2, Errors: 0, Failed: 0, Skipped: 0, Time: 0,709s

While it’s working, my NuGet packages are like this:

Id                                  Versions
--                                  --------
FsCheck                             {2.7.2} 
FsCheck.Xunit                       {2.7.2} 
Unquote                             {3.1.2} 
xunit.abstractions                  {2.0.0} 
xunit.extensibility.core            {2.1.0} 
xunit.extensibility.execution       {2.1.0} 
xunit.runner.console                {2.2.0}

Subsequently, I updated xUnit.net:

Id                                  Versions
--                                  --------
FsCheck                             {2.7.2} 
FsCheck.Xunit                       {2.7.2} 
Unquote                             {3.1.2} 
xunit.abstractions                  {2.0.1} 
xunit.extensibility.core            {2.2.0} 
xunit.extensibility.execution       {2.2.0} 
xunit.runner.console                {2.2.0} 

Now the tests no longer run:

$ packages/xunit.runner.console.2.2.0/tools/xunit.console.exe MyProperty/bin/Debug/MyProperty.dll
xUnit.net Console Runner (64-bit .NET 4.0.30319.42000)
  Discovering: MyProperty
  Discovered:  MyProperty
=== TEST EXECUTION SUMMARY ===
   MyProperty.dll  Total: 0

My App.config looks like this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="FSharp.Core" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.4.0.0" newVersion="4.4.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="xunit.core" publicKeyToken="8d05b1bb7a6fdb6c" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.2.0.3545" newVersion="2.2.0.3545" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

Is this a known issue, or am I missing something obvious?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:20 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
kurtschelfthoutcommented, Mar 14, 2017

Thanks! I joined the slack channel…will report back here if something comes out of it.

1reaction
kurtschelfthoutcommented, Mar 13, 2017

Or maybe I fucked up my experiment…

Yeah…independent reproduction is the basis of any scientific endeavour so I’ll start with that 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

X Unit test not compatible with .net core 2.2
I want to test my web application with XUnit or MSUnit but o have problem with it. The version of the Microsoft.NETCore.App package...
Read more >
Unable to update or install XUnit 2.2.0 in a .net 4.6.2 project
I'll let you file a NuGet issue, just create a new class library and try installing XUnit, you will then run in to...
Read more >
XUnit tests do not run in solution
NET Core 2.2. The problem is specifically with XUnit test projects, because NUnit and MsTest projects run tests normally. All the packages in ......
Read more >
too particular about .NET Core runtime version
Test Explorer recently stopped running my unit tests on the .NET Core runtime. Net472 tests still run fine. Looking at the Tests output ......
Read more >
Live Unit Testing FAQ - Visual Studio (Windows)
Yes. Live Unit Testing works with .NET Core and the .NET Framework. Configuration. Why doesn't Live Unit Testing work ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found