Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/ThreemaTests/Mocks/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 799 B image not shown  

Quelle  LicenseCredentialsLoaderMock.swift   Sprache: JAVA

 

import Foundation
@testable import Threema

/// A configurable implementation of `OnboardingLicenseCredentialsLoading` for testing
final class LicenseCredentialsLoaderMock: OnboardingLicenseCredentialsLoading {

    /// Credentials to return, `nil` for a keychain without usable credentials
    var credentials: LicenseCredentials?

    /// Error to throw instead of returning credentials
    var error: Error?

    private(set) var loadCredentialsCallCount = 0

    init(credentials: LicenseCredentials? = nil, error: Error? = nil) {
        self.credentials = credentials
        self.error = error
    }

    func loadCredentials() throws -> LicenseCredentials? {
        loadCredentialsCallCount += 1

        if let error {
            throw error
        }

        return credentials
    }
}

Messung
CHZG
879710094

¤ Dauer der Verarbeitung: 0.5 Sekunden  ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.