-
Notifications
You must be signed in to change notification settings - Fork 11
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
Make it easy to test simple interactions? #5
Comments
I think a good strategy might be to start writing HSpec tests, ensuring that functions to state them concisely are available. This is good because (1) testing is good and (2) writing a lot of code to use the library will help to asses where its design could be better. |
What about this?
I added a silly usage example with market. |
Thanks, that's great. It will probably be important to be able to also specify the kingdom cards, so that it's possible to test things like "play Workshop, gaining Feast, then Village drawing Feast, then play Feast". |
Implemented in 534f26c. You can pass options in to withHand [workshop, village, estate, estate, copper] [Card [feast]]. You also have the full game state, so you could modify the user's deck to place a feast on top for when you play village? |
I don't really know how to run any of this code right now "in isolation" - things seem geared towards playing entire games with a specified strategy. But there are a number of effects that I think have issues, and I'd like a way to write a test like "Here is a player's hand. After he does XYZ, his hand should change as follows, and the supply/trash should change as follows." This would help me verify my understanding of how things are put together, so that I can properly direct my efforts at improving them.
One example is that I think you're discarding cards immediately after playing them, rather than putting them into the play area and then discarding post-turn, which would be quite bad. Additionally, some trash/discard effects are not judicious enough, and can affect other cards in hand unintentionally. I'd like to test a player holding Throne Room and three Feast cards, and throning one of them. It should be the case that the played Feast is trashed while the other two stay in hand, and the player gains two cards. But I suspect that instead two Feasts will be trashed and one will be discarded.
The text was updated successfully, but these errors were encountered: