开发者

Integration testing with random outcomes

I'd like to write some integration tests for a card game I'm creating. However, it's based on a shuffle. The only solution I can think of to get predictable results to test is stubbing the shuffle, however I'm uncomfortab开发者_开发知识库le doing any stubbing in an integration test. Are there any alternative strategies?


What is the aim of the test?

Stubbing in an integration test is IMO fine, all tests should only test the components under test. One other option would be to allow the Shuffle to take a seed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜