单位/集成测试FTP访问 [英] Unit/Integration testing FTP access

查看:129
本文介绍了单位/集成测试FTP访问的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的团队成员正在写访问外部FTP站点下载文件的应用程序。写好我们希望能够做集成测试,无需使用物理FTP服务器,因为它是一个外部网站的代码。

A member of my Team is writing an application that accesses an external FTP site to download files. Having written the code we would like to be able to do integration testing without using a physical ftp server as it is an external site.

我们在过去做过类似的事情使用 nDumpster 用于模拟代码的SMTP服务器,我们想知道的如果有任何equilivent标准FTP可以使用服务器

We have done similar things in the past using nDumpster for simulating an smtp server in code and we are wondering if there are any equilivent compliant ftp servers that can be used?

编辑:

我要补充一点,这些都不是真正的单元测试,我们和那些嘲笑我们的ftp的实现。

I should add that these are not for true unit tests, we have those and mock our ftp implementation.

然而,我们在实际执行的接口使用WebFtpRequest.Create()。因此,测试此代码需要一个实际的服务器(除非我们在测试中注册自己的协议),最终我们将不得不对测试实际的服务器!

However we are using WebFtpRequest.Create() in the actual implementation of the interface. So testing this code requires an actual server (unless we register our own protocol in the tests) eventually we will have to test against an actual server!.

我们希望能够启动和停止在代码中的FTP服务器(就像你可以nDumpster),并检查了我们的呼吁是正确的。

We want to be able to start and stop the ftp server in code (much like you can nDumpster) and examine that our calls are correct.

推荐答案

我只需要类似的东西,并与解决方案结束了基于小的 fTPDMIN 命令行FTP服务器。 https://github.com/Buthrakaur/FtpIntegrationTesting

I just needed something similar and ended up with solution based on small FTPDMIN command-line FTP server. You can find my solution here: https://github.com/Buthrakaur/FtpIntegrationTesting

这篇关于单位/集成测试FTP访问的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆