-
Notifications
You must be signed in to change notification settings - Fork 337
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
Passive Customization Attributes are ignored when used in combination with [Frozen] #637
Comments
@sergeyshushlyapin, while I haven't added the jump in label to this issue, you're still more than welcome to attempt to address it. You seem to be on top of things 👍 |
The issue is not about the [Theory, AutoData]
public void StringLengthConstraintWorksWithoutFrozen([StringLength(3)]string str)
{
Assert.True(str.Length == 3); // pass
}
[Theory, AutoData]
public void StringLengthConstraintFailsWithFrozen([Frozen][StringLength(3)]string str)
{
Assert.True(str.Length == 3); // fails
} The underlying reason is in the wrong assumption that in order to create a specimen only type is required. In the Glue Libraries specimens can be defined by types and Customization Attributes. The FreezeOnMatchCustomization resolves specimens using type only which causes the issue: var specimen = context.Resolve(this.TargetType); |
Just a hint: as a potential way to fix this issue is to create a custom Update: disregard the comment above, I misunderstood the root of the issue. |
…ttributes-v4 Passive Customization Attributes are ignored when used in combination with [Frozen] (#637, xUnit.net2, v4)
…utes-nunit Passive Customization Attributes are ignored when used in combination with [Frozen] (#637, NUnit2, v4)
…utes-xunit.net Passive Customization Attributes are ignored when used in combination with [Frozen] (#637, xUnit.net, v4)
…utes-nunit3 Passive Customization Attributes are ignored when used in combination with [Frozen] (#637, NUnit3, v4)
Will be fixed in v4. |
If a test method parameter is decorated with both
[Substitute]
and[Frozen]
attributes, a concrete instance is created instead of a substitute. The following test fails:The issue has been addressed in PR #627 but it was agreed that the solution is sub-optimal. To be implemented in a new PR.
The text was updated successfully, but these errors were encountered: