atat
atat copied to clipboard
Ease testing with ATAT
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
Add an example using https://docs.rs/mockall/0.10.2/mockall/#sequences