Commit eab137d7 authored by 刘俊宏's avatar 刘俊宏

完善仓库管理列表上拉刷新的逻辑

parent 181ee164
...@@ -89,6 +89,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV ...@@ -89,6 +89,8 @@ class WarehoseMangementListVC: BaseViewController, UISearchBarDelegate, UITableV
}) })
}, completion: nil) }, completion: nil)
self.tableV?.mj_footer?.endRefreshing()
}) { (error) in }) { (error) in
self.tableV?.mj_header?.endRefreshing() self.tableV?.mj_header?.endRefreshing()
} }
......
...@@ -12,19 +12,26 @@ import XCTest ...@@ -12,19 +12,26 @@ import XCTest
class GeliBusinessPlatformTests: XCTestCase { class GeliBusinessPlatformTests: XCTestCase {
override func setUp() { override func setUp() {
// 每个类中 测试方法调用前 先调用这个方法 以方便 开发者 做些 测试前的准备
// Put setup code here. This method is called before the invocation of each test method in the class. // Put setup code here. This method is called before the invocation of each test method in the class.
} }
override func tearDown() { override func tearDown() {
// 当这个 类中的 所有的 测试 方法 测试完后 会调用这个方法
// Put teardown code here. This method is called after the invocation of each test method in the class. // Put teardown code here. This method is called after the invocation of each test method in the class.
} }
func testExample() { func testExample() {
// This is an example of a functional test case. // This is an example of a functional test case.
// Use XCTAssert and related functions to verify your tests produce the correct results. // Use XCTAssert and related functions to verify your tests produce the correct results.
// 测试方法样例
} }
func testPerformanceExample() { func testPerformanceExample() {
// 这是 我们做性能测试的方法 把要测试的方法 放进Block 就可以了
//这个方法主要是做性能测试的,所谓性能测试,主要就是评估一段代码的运行时间。该方法就是性能测试方法的样例。
// This is an example of a performance test case. // This is an example of a performance test case.
self.measure { self.measure {
// Put the code you want to measure the time of here. // Put the code you want to measure the time of here.
...@@ -32,3 +39,58 @@ class GeliBusinessPlatformTests: XCTestCase { ...@@ -32,3 +39,58 @@ class GeliBusinessPlatformTests: XCTestCase {
} }
} }
//断言
//单元测试是以代码测试代码。不是靠 NSLog 来测试,而是使用断言来测试的,提前预判条件必须满足
// // XCTAssert(expression, ...)
// // XCTAssert(条件, 不满足条件的描述)
//
// - (void)testExample {
// NSLog(@"自定义测试 testExample");
// int a = 3;
// XCTAssertTrue(a == 0, "a 不能等于 0");
// }
//无条件报错
//
//XCTFail. 生成一个无条件报错XCTFail(format...)
//
//等价测试
//
//XCTAssertEqualObjects. 当expression1不等于expression2时报错(或者一个对象为空,另一个不为空)XCTAssertEqualObjects(expression1, expression2, format...)
//
//XCTAssertNotEqualObjects. 当expression1等于expression2时报错。XCTAssertNotEqualObjects(expression1, expression2, format...)
//
//XCTAssertEqual. 当expression1不等于expression2时报错,这个测试用于C语言的标量。XCTAssertEqual(expression1, expression2, format...)
//
//XCTAssertNotEqual. 当expression1等于expression2时报错,这个测试用于C语言的标量。XCTAssertNotEqual(expression1, expression2, format...)
//
//XCTAssertEqualWithAccuracy. 当expression1和expression2之间的差别高于accuracy 将报错。这种测试适用于floats和doubles这些标量,两者之间的细微差异导致它们不完全相等,但是对所有的标量都有效。XCTAssertEqualWithAccuracy(expression1, expression2, accuracy, format...)
//
//XCTAssertNotEqualWithAccuracy. 当expression1和expression2之间的差别低于accuracy将产生失败。这种测试适用于floats和doubles这些标量,两者之间的细微差异导致它们不完全相等,但是对所有的标量都有效。XCTAssertNotEqualWithAccuracy(expression1, expression2, accuracy, format...)
//
//空测试
//
//XCTAssertNil. 当expression参数非nil时报错。XCTAssertNil(expression, format...)
//
//XCTAssertNotNil. 当expression参数为nil时报错。XCTAssertNotNil(expression, format...)
//
//XCTAssertTrue. 当expression计算结果为false时报错。XCTAssertTrue(expression, format...)
//
//XCTAssert. 当expression计算结果为false时报错,与XCTAssertTrue同义。XCTAssert(expression, format...)
//
//XCTAssertFalse. 当expression计算结果为true报错。XCTAssertFalse(expression, format...)
//
//异常测试
//
//XCTAssertThrows.当expression不抛出异常时报错。XCTAssertThrows(expression, format...)
//
//XCTAssertThrowsSpecific.当expression针对指定类不抛出异常时报错。XCTAssertThrowsSpecific(expression, exception_class, format...)
//
//XCTAssertThrowsSpecificNamed. 当expression针对特定类和特定名字不抛出异常时报错。对于AppKit框架或Foundation框架非常有用,抛出带有特定名字的NSException(NSInvalidArgumentException等等)。XCTAssertThrowsSpecificNamed(expression, exception_class, exception_name, format...)
//
//XCTAssertNoThrow. 当expression抛出异常时报错。XCTAssertNoThrow(expression, format...)
//
//XCTAssertNoThrowSpecific. 当expression针对指定类抛出异常时报错。任意其他异常都可以;也就是说它不会报错。XCTAssertNoThrowSpecific(expression, exception_class, format...)
//
//XCTAssertNoThrowSpecificNamed. 当expression针对特定类和特定名字抛出异常时报错。对于AppKit框架或Foundation框架非常有用,抛出带有特定名字的NSException(NSInvalidArgumentException等等)XCTAssertNoThrowSpecificNamed(expression, exception_class, exception_name, format...)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment