'Basic Assert in xUnit

Looking for a basic assert in xUnit. This is simple in MSTest and NUnit.

Assert.Fail("some message"); // MSTest - works
Assert.Fail("some message"); // NUnit - works (same syntax)
Assert.Fail("some message"); // xUnit - does not compile

The project is a C# xUnit Test Project (.NET Core) in Visual Studio 2019.

UPDATE

Responding to comments about what version of xUnit is installed. The NuGet package was installed automatically by Visual Studio when the project was created. The .csproj file reveals that Visual Studio installed version "2.4.0".



Solution 1:[1]

xunit 2.4.2-pre.12 contains the Assert.Fail(string) method.

However, as was pointed out in the comments, this was recently added so prior versions do not contain the Assert.Fail() method.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1