如何在Ios中测试标签栏? [英] How Do I Unit Test Tab Bars In Ios?

查看:71
本文介绍了如何在Ios中测试标签栏?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我刚刚开始学习IOS中的单元测试,我只完成了一些简单的任务。



所以基本上我创建了一个只有两个Tab键控制器标签。我如何测试确实只有两个选项卡?



另外,我有一个订单:第一个选项卡和第二个选项卡如何测试这些选项卡的顺序在断言第一个标签应该放在第一个,第二个标签应该放在第二个?



我假设我应该从Tests文件夹开始做一些事情使用XCTAssert,但是现在我不知道从什么开始。



有人能告诉我我该如何处理这个问题?



i没有找到任何有关此内容的好教程

So i just started to learning unit testing in IOS and i have few simple tasks to complete.

So basically i have created a Tab bar controller with only two tabs. How can i test that there indeed only two tabs ?

Also, i have an order: The first tab and the second tab How can i test the order of these tabs following the assertion that "first tab" should be placed first and "second tab" should be placed second ?

I assume that i should start from Tests folder and do something with XCTAssert, but for now i have no clue from what to start.

Could someone tell me how can i approach this?

i haven't found any good tutorials about this

推荐答案

首先测试在Apple上有所改变系统。阅读关于使用Xcode进行测试



您可以将Tabbar分配给插座,而不是访问选项卡阵列。要开始测试,请使用菜单产品 - >测试或产品 - >构建测试。测试仅在模拟器上运行。如果可行,可以在普通代码中使用NSAssert。
At first testing has changed somehow on Apple systems. ReadAbout Testing with Xcode.

You can assign the Tabbar to an outlet an than access the array of tabs. To start Testing, use on the Menu Product -> Test or Product->Build for Testing. Testing only runs on the simulator. If to feasable, you can use NSAssert in the normal code.


这篇关于如何在Ios中测试标签栏?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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