unit-testingmstestverify

Verify.MSTest usings


We are trying to use the Verify.MSTest (https://www.nuget.org/packages/Verify.MSTest) NuGet package in a .NET 4.7.2 unit test project. After adding the latest version of the package to the project, we also added <ImplicitUsings>enable</ImplicitUsings> to the csproj file as described in the readme.

But unfortunally we keep getting the error that the "Verify()" method cannot be found. "The name Verify does not exist in the current context". In which class is this method defined? Are we missing some usings on top of the file? Which usings are required to use Verify in a .NET 4.7.2 project?


Solution

  • You can get this error if you do not subclass your test with VerifyBase.

    For some reason that is required for MSTest, but I cannot find much documentation about it or why that is the case.