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

Predicates based on the type of an object #84

Open
Seddryck opened this issue Dec 11, 2022 · 0 comments
Open

Predicates based on the type of an object #84

Seddryck opened this issue Dec 11, 2022 · 0 comments
Labels
new-feature Request for a new feature in the tool

Comments

@Seddryck
Copy link
Owner

Seddryck commented Dec 11, 2022

It should be possible to validate with a predicate that an object is of a given type or implements an interface. The predicate instance-of(type) and the predicate implements(interface) are respectively asserting that the input object is of the type passed as the parameter or that it implements the interface given as parameter.

var predication = new Predication("implements(System.Collection.IList) |AND instance-of(\"List<string>\")");
Assert.That(predication.Evaluate(new List<string>()), Is.True);
@Seddryck Seddryck added the new-feature Request for a new feature in the tool label Dec 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature Request for a new feature in the tool
Projects
None yet
Development

No branches or pull requests

1 participant