         dbHelper.removeAllEntity("TestItem")
     }
     
+    func testRemoveAllEntityInBack() {
+        for _ in 0..<3 {
+            insertOneItem()
+        }
+        
+        let expectation = expectationWithDescription("testRemoveAllEntityInBack")
+        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) { 
+            let result = self.dbHelper.removeAllEntity(self.entityName)
+            XCTAssertTrue(result)
+            expectation.fulfill()
+        }
+        
+        waitForExpectationsWithTimeout(2) { (error) in
+            if let error = error {
+                print("wait error: \(error.localizedDescription)")
+            }
+        }
+    }
+    
     func testRemoveAllEntityConcurrent() {
         for _ in 0..<3 {
             insertOneItem()

        XCTAssertEqual(count2, 0)
    }
    
    func testCountForEntityConcurrent() {
        insertOneItem()
        

        let items = dbHelper.fetchEntity("TestItem")
        XCTAssertNotNil(items)
        XCTAssertTrue(items!.count != 0)
    }
    
    func testFetchOneEntityInBack() {
        insertOneItem()
        
        let expectation = expectationWithDescription("Test Fetch One Entity In Back")
        
        dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)) {
            let item: TestItem? = self.dbHelper.fetchOneEntity(self.entityName)
            XCTAssertNotNil(item)
            XCTAssertNotEqual(NSThread.currentThread(), NSThread.mainThread())
            expectation.fulfill()
        }
        
        waitForExpectationsWithTimeout(2) { (error) in
            if let error = error {
                print("wait error: \(error.localizedDescription)")
            }
        }
    }
    
    func testFetchOneEntityConcurrent() {
