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

Ease testing with ATAT #75

Open
MathiasKoch opened this issue Feb 3, 2021 · 1 comment
Open

Ease testing with ATAT #75

MathiasKoch opened this issue Feb 3, 2021 · 1 comment

Comments

@MathiasKoch
Copy link
Member

MathiasKoch commented Feb 3, 2021

Currently it is very hard to do unit tests that involve ATAT, due to the
fn send<A: AtatCmd>(&mut self, cmd: &A) -> nb::Result<A::Response, Error>; signature.

It would be nice to create and document some method of making it easy to do unittest involving sending multiple different commands after eachother, and asserting on the response.

Main problem is that even if instantiating a MockAtClient of some kind, that implements AtClient, it is very hard to construct a A::Response in a way fit for testing multiple send/receive cycles.

NOTE: This problem is not an actual problem for ATAT, but rather for the users of ATAT. Yet i think the solution should ideally come within ATAT

@MathiasKoch
Copy link
Member Author

Add an example using https://docs.rs/mockall/0.10.2/mockall/#sequences

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

1 participant