开发者交流平台
开发者交流平台

通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。

bj
登录
  • 友情链接
站内
unit-testing

unit-testing

go

深度相等性用于ssh.AuthMethod。

英文: (go) Deep equality for ssh.AuthMethod 问题 我正在使用 crypto/ssh 包,并且我正在尝试为构建 ClientConfig 的方法编写单元测试。 其...
huangapple 2022年4月2日148评论go unit-testing
go

您好!您想知道如何模拟 rand.Reader 失败以进行测试目的。

英文: How can I simulate a failure of rand.Reader for testing purposes? 问题 我正在尝试为我的函数编写单元测试;请注意,它调用了ra...
huangapple 2022年3月29日221评论go unit-testing
go

我可以为我的测试案例编写自己的go的http client.Do()函数版本吗?

英文: Can I write my own version of go's http client.Do() function for my test cases? 问题 我有一个名为use...
huangapple 2022年3月27日141评论go unit-testing
go

Ginkgo: 为单元测试模拟一个方法

英文: Ginkgo: Mocking a method for unit test 问题 请注意,结构体 S 实现了接口 I。 我正在尝试通过模拟来测试 MethodA 的 MethodB 响应。 ...
huangapple 2022年3月23日150评论go unit-testing
go

Golang:模拟响应测试HTTP客户端

英文: Golang: mock response testing http client 问题 我是你的中文翻译助手,以下是翻译好的内容: 我是Golang的新手,正在尝试为一个简单的HTTP客户端...
huangapple 2022年3月21日154评论go unit-testing
go

使用*s3.S3对象进行Golang单元测试

英文: Golang unittest with *s3.S3 object 问题 如何对以下代码进行单元测试。我尝试使用counterfiter来伪造输入的"*s3.S3"对象,...
huangapple 2022年3月15日149评论go unit-testing
go

如何在Golang中创建一个包含HTTP客户端的结构体的模拟对象?

英文: how to create a mock of a struct that includes a http client in golang? 问题 让我们来看一个例子: 包A: type C...
huangapple 2022年3月14日157评论go unit-testing
go

How to mock a third-party struct with many methods and perform unit tests on endpoints that depend on the third-party struct?

英文: How to mock a third-party struct with many methods and perform unit tests on endpoints that depe...
huangapple 2022年3月10日149评论go unit-testing
go

如何测试调用自己方法的结构体?

英文: How to test a struct that calls its own method? 问题 我有一个结构体: type foo struct { bar mockableInterf...
huangapple 2022年3月9日152评论go unit-testing
go

模拟一个 go-logr 并验证它记录的消息。

英文: Mock a go-logr and verify the message it logs? 问题 我正在使用go-logr/logr库。我有一个测试需要将logger作为参数传递,并检查它是...
huangapple 2022年3月9日157评论go unit-testing
70

文章导航

1 … 26 27 28 29 30 31 32 33 34 … 70
name
开发者交流平台
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
文章117266 留言 4 访客17631049

热门标签

css node.js typescript flutter android arrays reactjs c++ c# json sql go spring r python java html spring-boot pandas javascript

悟已往之不谏,知来者之可追!

今日
00%
已00小时
本周
00%
已过00天
本月
00%
已过00天
今年
00%
已是00月

Copyright ©  开发者交流平台 版权所有.

闽 ICP 备 2022019110 号 - 1
  • 开发者交流平台

    本页二维码