讓我給你講講 iOS 自動化測試的那些干貨(13)
發表于:2017-03-10來源:csdn作者:LeoMobileDeveloper點擊數:
標簽:iOS
(beTruthy()) } it( is smart ) { expect(Dolphin().isSmart). to (beTruthy()) } }} 1 2 3 4 5 6 7 8 9 10 11 12 1 2 3 4 5 6 7 8 9 10 11 12 可以看到,BDD的核心是行為。也就是說,需要關注的
(beTruthy())
}
it(
"is smart") {
expect(Dolphin().isSmart).
to(beTruthy())
}
}
}
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
1
-
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
可以看到,BDD的核心是行為。也就是說,需要關注的是一個類提供哪些行為。
用例集合,用describe和context描述
比如,驗證dolphin的click行為的時候,我們需要兩個用例。一個是is loud
,一個是has a high frequency
,就可以用describe將用例組織起來。
class
原文轉自:http://blog.csdn.net/hello_hwc/article/details/60957515