英文: How can I mock a method on Go? 问题 假设我有一个类型 foo,其中有一个方法 largerInt() 调用了 largeInt()。我想测试 largerInt...
How can I mock multiple types when the signature of a concrete method refers to another concrete type, not its interface?
英文: How can I mock multiple types when the signature of a concrete method refers to another concrete...
Golang模拟 – 类型冲突的问题
英文: Golang Mocking - problems with type collision 问题 我正在模拟一个DataStore和它的Get/Set功能。我遇到的问题是:无法将s(类型为Mo...
如何验证特定函数是否被调用
英文: How to verify if a specific function is called 问题 我正在尝试使用Go语言编写TDD(测试驱动开发)代码。然而,我在以下部分遇到了困难。 要编写...
如何模拟 http.Head() 函数?
英文: How to mock http.Head() 问题 我正在学习来自https://github.com/golang/example/tree/master/outyet的outyet示例项...
Golang与Martini:模拟测试示例
英文: Golang with Martini: Mock testing example 问题 我已经整理了一段代码,它在我的路由上执行了一个GET请求。我想使用模拟来测试这个代码。我是Go和测试方...
在Go中模拟接收函数
英文: Mocking receiver functions in Go 问题 我正在尝试对调用结构体中其他接收函数的接收函数进行单元测试。 假设我想测试以下代码中的Three()函数,并模拟对two...
Golang的http处理程序测试的模拟函数
英文: Golang mocking functions for http handler tests 问题 我正在为我的PostLoginHandler编写单元测试,并需要模拟一个会话中间件函数。在...
在Golang中,用于模拟第三方库的接口使用方法
英文: Interface use in golang for mocking third party libraries 问题 我正在尝试使用VMware vSphere API客户端(govmom...
在golang中测试第三方包。
英文: Testing 3rd party package in golang 问题 我是你的中文翻译助手,以下是你要翻译的内容: 我是golang的新手,尝试使用来自https://github.c...
19