Skip to content

Commit

Permalink
Update verify plugin for Verify v24 (#151)
Browse files Browse the repository at this point in the history
* Update verify dependency to latest version

* Removed adding UsesVerify Attribute as it was obsolete. As a result the generator was not needed anymore, so it is removed as well.

* update changelog

* Removed dependency on Microsoft.CSharp for Reqnroll.Verify.ReqnrollPlugin
Cleaned Reqnroll.Verify.ReqnrollPlugin.csproj to be more consistent with the other plugin project files
Fixed wrong tags in Reqnroll.Verify.nuspec

* Changed a few things left form the generator to runtime plugin conversion

* Removed not needed properties from csproj file
  • Loading branch information
ajeckmans committed Jun 10, 2024
1 parent f3ef016 commit dd7ecf6
Show file tree
Hide file tree
Showing 20 changed files with 93 additions and 179 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# [vNext]

* Reqnroll.Verify: Support for Verify v24 (Verify.Xunit v24.2.0) for .NET 4.7.2+ and .NET 6.0+. For earlier versions of Verify or for .NET 4.6.2, use the latest 2.0.3 version of the plugin that is compatible with Reqnroll v2.*. (#151)

## Improvements:

* Update [versioning policy for plugins](https://docs.reqnroll.net/latest/installation/compatibility.html#versioning-policy) and set plugin dependencies accordingly (#160)
Expand Down Expand Up @@ -37,15 +39,15 @@
## Bug fixes:

* Fix: User code namespaces that included "Reqnroll" within them caused the code generation to fail (#44)
* Fix: Dependencies of [BeforeTestRun] / [AfterTestRun] hooks are wonrly resolved from the test thread context instead of the test run (global) context instead (#58)
* Fix: Dependencies of [BeforeTestRun] / [AfterTestRun] hooks are wrongly resolved from the test thread context instead of the test run (global) context instead (#58)
* Fix: Cucumber Expressions fail when two enums or two custom types with the same short name (differing namespaces) are used as parameters (#81)
* Fix: Adding `@ignore` to an Examples block generates invalid code for NUnit v3+ (#103)
* Fix: `@ignore` attribute is not inherited to the scenarios from Rule (#111)
* Fix: Capture ExecutionContext after every binding invoke (#120)
* Fix: StackOverflowException when using `[StepArgumentTransformation]` with same input and output type, for example string (#71)
* Fix: Autofac without hook does not run GlobalDependencies (#127)
* Fix: Reqnroll.Autofac shows wrongly ambiguous step definition (#56)
* Fix: Dispose objects registred in test thread container at the end of test execution (#123)
* Fix: Dispose objects registered in test thread container at the end of test execution (#123)

# v1.0.1 - 2024-02-16

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Utf8Json" Version="1.3.7" />

<PackageReference Include="CsvHelper" Version="27.2.1" />

<PackageReference Include="ExcelDataReader" Version="3.6.0" />
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,55 +1,48 @@
<Project>

<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<Import Project="..\..\..\Tests\Reqnroll.Specs\build/Reqnroll.Tools.MsBuild.Generation.OwnTests.props" />
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk"/>
<Import Project="..\..\..\Tests\Reqnroll.Specs\build/Reqnroll.Tools.MsBuild.Generation.OwnTests.props"/>

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
<PackageReference Include="Verify.Xunit" Version="17.7.0" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0"/>
<PackageReference Include="Verify.Xunit" Version="24.2.0"/>
<PackageReference Include="xunit" Version="2.8.1"/>
<PackageReference Include="xunit.runner.console" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Plugins\Reqnroll.xUnit.ReqnrollPlugin\Reqnroll.xUnit.ReqnrollPlugin.csproj" />
<ProjectReference Include="..\Reqnroll.Verify.ReqnrollPlugin\Reqnroll.Verify.ReqnrollPlugin.csproj" />
<ProjectReference Include="..\..\..\Plugins\Reqnroll.xUnit.ReqnrollPlugin\Reqnroll.xUnit.ReqnrollPlugin.csproj"/>
<ProjectReference Include="..\Reqnroll.Verify.ReqnrollPlugin\Reqnroll.Verify.ReqnrollPlugin.csproj"/>
</ItemGroup>

<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />

<PropertyGroup>
<_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_VerifyGeneratorPluginFramework>
<_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462</_VerifyGeneratorPluginFramework>
</PropertyGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk"/>

<Target Name="PreBuild">
<MSBuild Projects="..\..\..\Reqnroll.Tools.MsBuild.Generation\Reqnroll.Tools.MsBuild.Generation.csproj" ContinueOnError="false" Properties="TargetFramework=$(_Reqnroll_Needed_MSBuildGenerator)" />
<MSBuild Projects="..\..\..\Plugins\Reqnroll.xUnit.Generator.ReqnrollPlugin\Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj" ContinueOnError="false" Properties="TargetFramework=netstandard2.0" />
<MSBuild Projects="..\Reqnroll.Verify.ReqnrollPlugin\Reqnroll.Verify.ReqnrollPlugin.csproj" ContinueOnError="false" Properties="TargetFramework=$(_VerifyGeneratorPluginFramework)" />
<MSBuild Projects="..\..\..\Reqnroll.Tools.MsBuild.Generation\Reqnroll.Tools.MsBuild.Generation.csproj" ContinueOnError="false" Properties="TargetFramework=$(_Reqnroll_Needed_MSBuildGenerator)"/>
<MSBuild Projects="..\..\..\Plugins\Reqnroll.xUnit.Generator.ReqnrollPlugin\Reqnroll.xUnit.Generator.ReqnrollPlugin.csproj" ContinueOnError="false" Properties="TargetFramework=netstandard2.0"/>
</Target>

<ItemGroup>
<ReqnrollGeneratorPlugins Include="$(MSBuildThisFileDirectory)..\Reqnroll.Verify.ReqnrollPlugin\bin\$(Configuration)\$(_VerifyGeneratorPluginFramework)\Reqnroll.Verify.ReqnrollPlugin.dll" />
<ReqnrollGeneratorPlugins Include="$(MSBuildThisFileDirectory)..\..\Reqnroll.xUnit.Generator.ReqnrollPlugin\bin\$(Configuration)\netstandard2.0\Reqnroll.xUnit.Generator.ReqnrollPlugin.dll" />
<ReqnrollGeneratorPlugins Include="$(MSBuildThisFileDirectory)..\..\Reqnroll.xUnit.Generator.ReqnrollPlugin\bin\$(Configuration)\netstandard2.0\Reqnroll.xUnit.Generator.ReqnrollPlugin.dll"/>
</ItemGroup>

<ItemGroup>
<Folder Include="Features\" />
<Folder Include="Features\"/>
</ItemGroup>

<Import Project="..\..\..\Reqnroll.Tools.MsBuild.Generation\build\Reqnroll.Tools.MsBuild.Generation.targets" />
<Import Project="..\..\..\Reqnroll.Tools.MsBuild.Generation\build\Reqnroll.Tools.MsBuild.Generation.targets"/>
<!-- has to be before the PropertyGroup change-->
<PropertyGroup>
<BuildDependsOn>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
<NuspecFile>$(MSBuildThisFileDirectory)Reqnroll.Verify.nuspec</NuspecFile>
<TargetFrameworks>net472;net6.0</TargetFrameworks>
<AssemblyOriginatorKeyFile>$(Reqnroll_KeyFile)</AssemblyOriginatorKeyFile>
<SignAssembly>$(Reqnroll_EnableStrongNameSigning)</SignAssembly>
<PublicSign>$(Reqnroll_PublicSign)</PublicSign>

<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<NuspecFile>$(MSBuildThisFileDirectory)Reqnroll.Verify.nuspec</NuspecFile>

<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" />
<PackageReference Include="Verify" Version="17.7.0" />
<PackageReference Include="Verify.Xunit" Version="24.2.0"/>
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\Reqnroll.Generator\Reqnroll.Generator.csproj" />
<ProjectReference Include="..\..\..\Reqnroll\Reqnroll.csproj"/>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,26 @@
<icon>images\reqnroll-icon.png</icon>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<license type="expression">BSD-3-Clause</license>
<tags>reqnroll externaldata json</tags>
<tags>reqnroll verify</tags>
<copyright>$copyright$</copyright>

<dependencies>
<group targetFramework=".NETFramework4.6.2">
<group targetFramework="net472">
<dependency id="Reqnroll" version="$CompatibilityVersionRange$" />
<dependency id="Verify" version="17.7.0" />
<dependency id="Verify" version="24.2.0" />
</group>
<group targetFramework="netstandard2.0">
<group targetFramework="net6.0">
<dependency id="Reqnroll" version="$CompatibilityVersionRange$" />
<dependency id="Verify" version="17.7.0" />
<dependency id="Verify" version="24.2.0" />
</group>
</dependencies>

</metadata>
<files>
<file src="build\**\*" target="build"/>

<file src="bin\$config$\net462\**\*" target="build\net462"/>
<file src="bin\$config$\netstandard2.0\*" target="build\netstandard2.0"/>

<file src="bin\$config$\net462\Reqnroll.Verify.ReqnrollPlugin.*" target="lib\net462"/>
<file src="bin\$config$\netstandard2.0\Reqnroll.Verify.ReqnrollPlugin.*" target="lib\netstandard2.0"/>
<file src="bin\$config$\net472\Reqnroll.Verify.ReqnrollPlugin.*" target="lib\net472"/>
<file src="bin\$config$\net6.0\Reqnroll.Verify.ReqnrollPlugin.*" target="lib\net6.0"/>

<file src="$SolutionDir$LICENSE" target="LICENSE" />
<file src="$SolutionDir$reqnroll-icon.png" target="images\" />
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System.Collections;
using System.IO;
using Reqnroll.Verify.ReqnrollPlugin;
using Reqnroll;
using Reqnroll.Plugins;
using Reqnroll.UnitTestProvider;
using Reqnroll.Verify.ReqnrollPlugin;
using VerifyTests;
using VerifyXunit;

[assembly: RuntimePlugin(typeof(VerifyRuntimePlugin))]

Expand All @@ -28,7 +28,7 @@ private void RuntimePluginTestExecutionLifecycleEvents_BeforeScenario(object sen
var scenarioContext = e.ObjectContainer.Resolve<ScenarioContext>();
var featureContext = e.ObjectContainer.Resolve<FeatureContext>();

VerifierSettings.DerivePathInfo(
Verifier.DerivePathInfo(
(sourceFile, projectDirectory, type, method) =>
{
string scenarioInfoTitle = scenarioContext.ScenarioInfo.Title;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" TreatAsLocalProperty="TaskFolder;TaskAssembly">
<ItemGroup>
<ReqnrollGeneratorPlugins Include="$(_VerifyGeneratorPluginPath)" />
</ItemGroup>
<ItemGroup>
<None Include="$(_VerifyRuntimePluginPath)">
<Link>%(Filename)%(Extension)</Link>
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<Visible>False</Visible>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' == 'Core'">netstandard2.0</_VerifyGeneratorPluginFramework>
<_VerifyGeneratorPluginFramework Condition=" '$(MSBuildRuntimeType)' != 'Core'">net462</_VerifyGeneratorPluginFramework>

<_VerifyGeneratorPluginPath>$(MSBuildThisFileDirectory)$(_VerifyGeneratorPluginFramework)\Reqnroll.Verify.ReqnrollPlugin.dll</_VerifyGeneratorPluginPath>

<_VerifyRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' == '.NETFramework' ">net472</_VerifyRuntimePlugin>
<_VerifyRuntimePlugin Condition=" '$(TargetFrameworkIdentifier)' != '.NETFramework' ">net6.0</_VerifyRuntimePlugin>
<_VerifyRuntimePluginPath>$(MSBuildThisFileDirectory)..\lib\$(_VerifyRuntimePlugin)\Reqnroll.Verify.ReqnrollPlugin.dll</_VerifyRuntimePluginPath>
</PropertyGroup>
</Project>
6 changes: 3 additions & 3 deletions Tests/Reqnroll.GeneratorTests/Reqnroll.GeneratorTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2">
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.console" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
14 changes: 7 additions & 7 deletions Tests/Reqnroll.PluginTests/ExternalData/CsvLoaderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public void Can_read_simple_csv_file()
{
var sut = CreateSut();
var result = sut.LoadDataSource(_productsSampleFilePath, null);

Assert.True(result.IsDataTable);
Assert.Equal(3, result.AsDataTable.Items.Count);
Assert.Equal("Chocolate", result.AsDataTable.Items[0].Fields["product"].AsString());
Expand Down Expand Up @@ -53,7 +53,7 @@ public void Can_handle_relative_path()
{
var sut = CreateSut();
var result = sut.LoadDataSource(
Path.GetFileName(_productsSampleFilePath),
Path.GetFileName(_productsSampleFilePath),
SampleFeatureFilePathInSampleFileFolder);

Assert.True(result.IsDataTable);
Expand All @@ -63,8 +63,8 @@ public void Can_handle_relative_path()
public void Can_handle_invalid_path()
{
var sut = CreateSut();
Assert.Throws<ExternalDataPluginException>(() =>

Assert.Throws<ExternalDataPluginException>(() =>
sut.LoadDataSource(
"no-such-file.csv",
SampleFeatureFilePathInSampleFileFolder));
Expand All @@ -76,7 +76,7 @@ public void Can_handle_invalid_csv_file_format()
_productsSampleFilePath = Path.Combine(SampleFilesFolder, "products-invalid.csv");

var sut = CreateSut();
Assert.Throws<ExternalDataPluginException>(() =>
Assert.Throws<ExternalDataPluginException>(() =>
sut.LoadDataSource(_productsSampleFilePath, null));
}

Expand All @@ -86,11 +86,11 @@ public void Can_handle_empty_csv_with_header_only()
_productsSampleFilePath = Path.Combine(SampleFilesFolder, "products-empty.csv");

var sut = CreateSut();

var result = sut.LoadDataSource(_productsSampleFilePath, null);

Assert.True(result.IsDataTable);
Assert.Equal(0, result.AsDataTable.Items.Count);
Assert.Empty(result.AsDataTable.Items);
}
}
}
6 changes: 3 additions & 3 deletions Tests/Reqnroll.PluginTests/Reqnroll.PluginTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.2.0" />
<PackageReference Include="FluentAssertions" Version="6.7.0" />
<PackageReference Include="Moq" Version="4.17.2" />
<PackageReference Include="xunit" Version="2.4.2" />
<PackageReference Include="xunit.runner.console" Version="2.4.2">
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.console" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.5">
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit dd7ecf6

Please sign in to comment.