-
Notifications
You must be signed in to change notification settings - Fork 9
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
Assertions assertInitial, assertNotInitial #26
Comments
Just out of curiosity: what's the use case for such assertions? To express the intent, an
|
In my test I want to check whether the http service call was triggered. The http client is mocked for the test and while it is triggered a delegate is called. In the delegate I stored the Request structure and with assertInitial I want to check whether it was filled: @Test void createBinding()
{
Request request;
requests.setNoContentResponse(HttpMethod.post, "/apps/myapp/bindings", (r) {
request = r;
});
cut.execute(["myapp", "--binding", "b1"]);
assertFalse(request == Request.init);
} |
OK: this is a problem related to mocking.
I don't like the idea of supporting "approach 3" with a rather special assertion. BTW: we abandoned hand-made mocks in favour of a mocking framework: |
I would like to test whether a struct is initial or not.
As workaround assertTrue, assertSame could be used but two new assertions
assertInitial
andassertNotInitial
would be more expressive.The text was updated successfully, but these errors were encountered: