remove support for hashing parameters#1449
Conversation
|
Hi @SimonCropp ! |
|
@michaelmadegard can you share an example of you test and the parameter values |
Actually I'm using Verify alongside SpecFlow so the underlying code is generated. But these steps in SpecFlow simply verify the content of ZIP archives that are generated by my code, such as :
I do not provide anything but the path to the ZIP archive. |
|
example of your .verified file name? |
|
Actually my case relates to the name of the folder that contains the .verified files, as it concerns an archive that is unzipped.
Without the HashParameters it became something like :
The .verified files inside the unzipped folder are OK. |
|
and the combination of all those parameters 5 parameters is distinct for every test ? |
|
Yes, so I correctly got one folder (with a unique hash) by test case. |
|
@SimonCropp I also use the If this is omitted, I sometimes have file names that are approx. 400-500 characters long. This simply results from the number of parameters and their contents. Some of them are also multiline strings. Would it be an option to work with a conditional versioning of <ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' or '$(TargetFramework)' == 'net7.0' ">
<PackageVersion Include="System.IO.Hashing" Version="8.0.0" />
</ItemGroup>
<ItemGroup Condition=" '$(TargetFramework)' != 'net6.0' and '$(TargetFramework)' != 'net7.0' ">
<PackageVersion Include="System.IO.Hashing" Version="9.0.4" />
</ItemGroup> |
Looks good, perfect 1:1 replacement without any code changes after upgrading to 30.0.0 and additional package |
Hello @SimonCropp, |
ie the
HashParametersmethod on settings.It is getting difficult to maintain this since System.IO.Hashing has dropped support for net6 and net7
also IMO i think it is a flawed feature. and instead for long parameter names, they should be overridden on a per-parameter basis using https://github.com/VerifyTests/Verify/blob/bed799382b1c296374416ca518a6c5e2fdb9468b/docs/parameterised-nunit.md#useparameters
https://github.com/VerifyTests/Verify/blob/bed799382b1c296374416ca518a6c5e2fdb9468b/docs/parameterised-nunit.md#hashing-parameters