here we go

This commit is contained in:
John Rommel Estropia
2014-12-07 21:38:54 +09:00
parent 25bc4a189f
commit daa5e64ae0
18 changed files with 1490 additions and 12 deletions

View File

@@ -23,7 +23,38 @@ class HardcoreDataTests: XCTestCase {
func testExample() {
// This is an example of a functional test case.
XCTAssert(true, "Pass")
#if DEBUG
let resetStoreOnMigrationFailure = true
#else
let resetStoreOnMigrationFailure = false
#endif
switch HardcoreData.defaultStack.addSQLiteStore(resetStoreOnMigrationFailure: resetStoreOnMigrationFailure) {
case .Failure(let error):
NSException(
name: "CoreDataMigrationException",
reason: error.localizedDescription,
userInfo: error.userInfo).raise()
default: break
}
HardcoreData.performTransaction { (transaction) -> () in
let obj = transaction.context.findFirst(FlickrPhoto)
transaction.commit { (result) -> () in
switch result {
case .Success(let hasChanges):
JEDump(hasChanges, "hasChanges")
case .Failure(let error):
JEDump(error, "error")
}
}
}
}
func testPerformanceExample() {