简体   繁体   English

集成测试还是单元测试?

[英]Integration Testing or Unit Testing?

I'm trying to figure out how to Unit Test a login and I'm wondering if testing the login stage would be Unit Testing or Integration Testing? 我试图弄清楚如何对登录进行单元测试,并且想知道测试登录阶段是单元测试还是集成测试?

I've searched to see if there is an example or to see if it is explained but I'm unable to find an answer. 我已经搜索过是否有示例,或者是否有解释,但找不到答案。

The login stage is just a simple Email and Password to log in with. 登录阶段只是用于登录的简单电子邮件和密码。

Testing a single login component would be a unit test. 测试单个登录组件将是单元测试。 Access to any directory or data store should be mocked. 应该嘲笑对任何目录或数据存储的访问。

If your test includes a page, a database or directory, or anything else than a single component it's an integration test. 如果您的测试包含页面,数据库或目录,或者除单个组件之外的任何其他内容,则这是集成测试。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM