简体   繁体   English

为什么要在Xcode项目中测试以及UITest和xctest文件。

[英]Why test and UITest and xctest file in Xcode project.

Its a very basic thing that in Xcode once we create the application multiple files are created default. 这是非常基本的事情,在Xcode中,一旦我们创建应用程序,就会默认创建多个文件。

  1. projectName.xctest projectName.xctest
  2. projectNameTests.m projectNameTests.m
  3. projectNameUITests.m projectNameUITests.m
  4. projectName.entitlements projectName.entitlements

Can any one know the perps of these files and how and what can we use them. 任何人都可以知道这些文件的权限以及我们如何以及如何使用它们。

Thanks 谢谢

These files are related to doing Unit testing the project. 这些文件与对项目进行单元测试有关。 Once you will learn unit testing you will understand the basics and purpose of these files. 学习了单元测试后,您将了解这些文件的基本知识和目的。

.xctest file is the file when you use XCtest framework to write a unit test case for your project. .xctest文件是使用XCtest框架为项目编写单元测试用例时的文件。

projectNameTests.m - Unit test case which will have your unit test which you will be writing for your business logic. projectNameTests.m-单元测试用例,其中将包含要为业务逻辑编写的单元测试。

projectNameUITests.m - This file will be having the unit test cases for UI. projectNameUITests.m-此文件将具有UI的单元测试用例。

projectName.entitlements - Entitlements confer specific capabilities or security permissions to your iOS or macOS app. projectName.entitlements-权利为您的iOS或macOS应用赋予特定功能或安全权限。

Please always to some basic search to find the answer. 请始终进行一些基本搜索以找到答案。

https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AboutEntitlements.html https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/EntitlementKeyReference/Chapters/AboutEntitlements.html

https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/04-writing_tests.html https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/testing_with_xcode/chapters/04-writing_tests.html

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

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