用于单元测试的模拟 FtpClient - C#

问题描述 投票:0回答:0

我正在使用 Moq 框架用 C# 编写单元测试。我如何模拟以下代码行?

FtpClient client = new (Host, Username, Password, Port);
client.Connect();

我应该用什么来代替上述参数,因为我收到错误

no such host is known or failed to connect to host

c# unit-testing moq ftp-client
© www.soinside.com 2019 - 2024. All rights reserved.