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
Provide pioneer own AssertJ assertions #232
Comments
I've been thinking about writing an entire separate part for single test assertions (because we do a LOT of single test assertions)
We could write:
Or maybe even:
But that seems slightly overkill to me. |
Generally speaking, and from an API point of perspective. i would recommend to think what would a user need, and not just what is sufficient for our usecase. Hence that i would actually prefer a way where i can request a specific amount of tests like
and based on that we could further test for
so we can use the same asserts on one or 2 or n test results. if we than create a wrapper method which is name |
What I meant was: Edit of shame: I misunderstood what you meant. Of course we could also have the same interface for multiple tests:
Did you mean it like that? If so, you are absolutely right. |
Where do we stop, though? You could even do something like this:
But that seems like a lot of effort for something that's meant to be used internally only. |
well the initial goal is to use it internally, but what if your code and the usage is so beautiful and intuitive that this might even be used in other junit5 extension for assertions :) who knows. |
In 0b79db8 (#6 / #218), we moved all assertion-like methods onto the `ExecutionResults` class even though that wasn't a good fit. The intention was to collect all such methods to then more easily replace them with proper AssertJ-like assertions that we needed to write ourselves. This change implements these methods. The API is pretty good already, but we expect that after using it for a while the experience with it as well as new use cases may lead to further changes (see #298). Closes: #232 PR: #245
When checking
ExcecutionResults
inside a test class forThrowable
s you have to go through the results and filter them. While doing this, already assertions are made that there are such results. Furthermore to avoid repeated codes some assertions were moved into a method inside the test class and were so hided when only looking at the acutal test case.We also have some private
assertThat...
methods in some extension test classes which can be used in other tests so. Moreover there are no goodassertThat(results)
methods in the default AssertJ API. So in stream the idea came up to provide some own AssertJ assertion methods, to do something like the following.Another one:
Examples can be seen at this tutorial
The text was updated successfully, but these errors were encountered: