Skip to content

Conversation

@icalvo
Copy link
Contributor

@icalvo icalvo commented Aug 29, 2023

This PR implements a part of #634.

Arg.AnyType does not work when the type we replace has generic constraints. Therefore we converted AnyType to an interface so that the user can implement a custom class that satisfies the constraints.

Arg.Is matcher was not supported by the former PR (#715).

XML-Doc comments have been added to Arg.AnyType.

/// If the generic type parameter has constraints, you will have to create a derived class/struct that
/// implements those constraints.
/// </remarks>
public interface AnyType
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thought: what do you think about providing implementations for common constraints? In particular AnyClass (with default ctor to match : class, new()), and AnyStruct or AnyValueType.

@dtchepak dtchepak merged commit 6db536b into nsubstitute:main Sep 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants