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

New constructors for Assertion #161

Open
fabriciofx opened this issue Jul 13, 2020 · 5 comments
Open

New constructors for Assertion #161

fabriciofx opened this issue Jul 13, 2020 · 5 comments

Comments

@fabriciofx
Copy link

fabriciofx commented Jul 13, 2020

Let's add new constructors do Assertion to make it easier to use:

Assertion(final T test, final Matcher<T> matcher) {
    this("", test, matcher);
}
Assertion(final Text msg, final T test, final Matcher<T> matcher) {
   ....
}
@fabriciofx fabriciofx changed the title New constructos for Assertion New constructors for Assertion Jul 13, 2020
@fabriciofx
Copy link
Author

@victornoel WDYT?

@victornoel
Copy link
Collaborator

@fabriciofx I don't think we should allow for no message, since it is also enforced in qulice that there should be a message passed to assertions (even though it is only enforced for MatcherAssert, the intention is the same).

Concerning the second one, what would be the need? I don't see any

@andreoss
Copy link
Contributor

it is also enforced in qulice that there should be a message passed to assertions
@victornoel It is forced by forbidden-apis

@fabriciofx There could be a different Assertion for that (See: #156).
For example, it would make sense to omit message if several assertions are grouped

new AllOf("must be ...", new Assertion<>(...), new Assertion<>(...))

@llorllale
Copy link
Owner

@andreoss

@fabriciofx There could be a different Assertion for that (See: #156).
For example, it would make sense to omit message if several assertions are grouped

new AllOf("must be ...", new Assertion<>(...), new Assertion<>(...))

Your example is inverting the dependencies; it should be new Assertion<>("text", text, new AllOf<Text>(......))

@andreoss
Copy link
Contributor

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

No branches or pull requests

4 participants