Swift?????Nimble????е??????
????? ???????[ 2015/7/15 10:12:54 ] ??????????????????
????Nimble ??????????? ??????? ???????Nimble ?????????? ????????????????????????Xcode 6 ?????????? XCTest ????????????????? Nimble ?????????б?????????? XCTest??????????? Xcode ?????????????????????????????? Target???????????????? Target ???????????? Target??
????????????? Xcode ????????????? Target????????? Command + U ???????в?????????????? Xcode ?????????????????
?????????????????????е???? MyTestTests.swift??
import UIKit
import XCTest
class MyTestTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
func testExample() {
// This is an example of a functional test case.
XCTAssert(true?? "Pass")
}
func testPerformanceExample() {
// This is an example of a performance test case.
self.measureBlock() {
// Put the code you want to measure the time of here.
}
}
}
???????????????е????????????? XCTestCase?????????????????????????????? test ????????????? testExample ?? testPerformanceExample ?????????????????????????? testExample ???????????????? XCTAssert(true?? "Pass") ???????????????????????????????????????????? XCAssert ????????е????????? true ??????????????????????????????????????????????
????func testExample() {
????// This is an example of a functional test case.
????var i = 1;
????XCTAssert(i == 0?? "variable i shoule be zero.")
????}
????????????????ж???? i ??????0???????????? i ???? 1?????????????? Command + U ?????в????????????????????????????????????
?????????????Xcode ?? XCAssert ???????????????????????????????????????????????????????е????á?
??????? XCTest ????????? XCAssert ???????????????????????????? Nimble ??? ???????XCTest ??????????е?????????????????棬??????????ж?????????????????????????????????????????????????????????
????Nimble ??????????????????? XCTest ???????????????????? BDD(????????????????????????) ?????
??????????????????????? Nimble ??????????????????
????????????? Nimble ??????????У????? .xcodeproj ????????????У?
???????????? Nimble-iOS ??????? Target ????????????????
???????????????? testExample ??????
????func testExample() {
????var i = 1;
????expect(i).to(equal(0))
????}
??????????????????????????? expect(i).to(equal(0))????????????~???????о??????????????????????????????????????XCTAssert(i == 0?? "variable i shoule be zero.") ?????о?????????????????? expect(i).to(equal(0)) ?·????????仰?????????????????“???????? i ???? 0 ”??
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11