Closed JiangHanChao closed 2 years ago
例如:
patches := ApplyFuncSeq(cmdutil.RunCmd, []OutputCell{ {Values: Params{"123", nil}, ParamCheck: Params{123}}, {Values: Params{"", ErrTestExcept}, ParamCheck: Params{-1}}, })
对 cmdutil.RunCmd 函数的多次mock中先检查实际运行时参数是否和期望一致,在很多测试工程中都对参数校验有要求以保证可靠性 不知道gomonkey是否有该方面的想法或者不支持的原因?
cmdutil.RunCmd
这个考虑过,想法是在gomonkey既有领域模型之上提供一套完备的DSL,但由于业余时间冲突较多,还没来得及落地。不过以前写过一个demo,你可以看看:https://github.com/agiledragon/gomonkey/blob/master/test/dsl_test/func_dsl_test.go.
欢迎共创!
例如:
对
cmdutil.RunCmd
函数的多次mock中先检查实际运行时参数是否和期望一致,在很多测试工程中都对参数校验有要求以保证可靠性 不知道gomonkey是否有该方面的想法或者不支持的原因?