         
         switch cardManager.searchCards(identity: "Alice").startSync() {
         case .success(_): XCTFail()
-        case .failure(_): break
-        }
-    }
-}
+        case .failure(let error):
+            guard let error = error as? CardManagerError,
+                error == .gotWrongCard else {
+                    XCTFail()
+                    return
+            }
+        }
+    }
+}

        
        switch cardManager.getCard(withId: "375f795bf6799b18c4836d33dce5208daf0895a3f7aacbcd0366529aed2345d4").startSync() {
        case .success: XCTFail()
        case .failure: break
        }
    }


        let generator = self.utils.getGeneratorJwtProvider(withIdentity: "identity", error: nil)
        
        let cardManagerParams = CardManagerParams(cardCrypto: self.cardCrypto, accessTokenProvider: generator, cardVerifier: VerifierStubFalse())
        cardManagerParams.cardClient = self.cardClient
        
        let cardManager = CardManager(params: cardManagerParams)
        
        var errorWasThrown = false
        do {
          _ = try cardManager.importCard(fromBase64Encoded: self.testsDict["STC-3.as_string"] as! String)
        } catch CardManagerError.cardIsNotVerified {
            errorWasThrown = true
        }
        catch {
            XCTFail()
        }

        XCTAssert(errorWasThrown)
