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

feat: add negative integration tests #85

Merged
merged 3 commits into from
Apr 20, 2023
Merged

Conversation

itegulov
Copy link
Contributor

This PR streamlines writing integration tests and introduces a bunch of negative scenarios.

@itegulov itegulov requested a review from volovyks April 20, 2023 07:40
Copy link
Collaborator

@volovyks volovyks left a comment

Choose a reason for hiding this comment

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

Looks awesome overall. Only some minor questions.

mod key {
use rand::{distributions::Alphanumeric, Rng};

pub fn random() -> String {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let;s clarify that this is a sk. And I guess it's better to return it as a SecretKey type and stringify if needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The reason why I went with strings everywhere is because I wanted to be uniform with malformed values (which are not representable with the strict SecretKey type).

})
.await?;
assert_eq!(status_code, 500);
assert!(matches!(new_acc_response, NewAccountResponse::Err { .. }));
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we comapre the error message here? Check for actual erro type?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We could yeah. I think generally parameterizing NewAccountResponse::Err with kind could be a good idea.

@volovyks volovyks merged commit 10822e6 into develop Apr 20, 2023
@itegulov itegulov deleted the daniyar/negative-tests branch July 20, 2023 05:24
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