bytedance / mockey

a simple and easy-to-use golang mock library
Apache License 2.0
556 stars 22 forks source link

feat: support multi-condition mocking #23

Closed Sychorius closed 1 year ago

Sychorius commented 1 year ago

Change-Id: I8e77443eaf100c724926c22f6ca6ee1e926d5cb0

What type of PR is this?

feat: support multi-condition mocking like Mock(target).When(cond1).Return(1).When(cond2).Return(2).Build()

What this PR does / why we need it (en: English/zh: Chinese):

en: Support multiple condition mocking so developers can select which value to return in specific condition more easily zh: 提供更加优雅的方式让单测编写者能更简单地选择不同条件下的返回值