Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update verify2 #170

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

## Improvements:

* 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)

## Bug fixes:

*Contributors of this release (in alphabetical order):*
*Contributors of this release (in alphabetical order):* @ajeckmans

# v2.0.3 - 2024-06-10

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