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

How to mock a Card #50

Closed
Fethbita opened this issue Apr 14, 2024 · 3 comments
Closed

How to mock a Card #50

Fethbita opened this issue Apr 14, 2024 · 3 comments

Comments

@Fethbita
Copy link

Hi, I am writing an application that uses pcsc and I have a struct that holds a Card. Some functions of this struct use card.transmit to send and receive APDUs and process them. I would like to be able to mock Card so that I can test these processing functions. What do you use for mocking Card?

@bluetech
Copy link
Owner

It mostly depends, do you care about the actual APDUs/RAPDUs i.e. do you want to simulate the logic of an actual card, or do you just need some dummy for tests?

@Fethbita
Copy link
Author

Fethbita commented Apr 18, 2024

I only need a dummy for tests to begin with.

Edit: When I say dummy, for my use case it would be the best if I could choose what the transmit function returns, that way I could test the functions with test vectors.

@Fethbita
Copy link
Author

Fethbita commented Oct 7, 2024

Is not an issue. I fixed is as in the PR (Fethbita/emrtd#4) and as in the issue (Fethbita/emrtd#2) recommended by dishmaker.

@Fethbita Fethbita closed this as completed Oct 7, 2024
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

2 participants