Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  LicenseStoreAdapterMock.swift   Sprache: JAVA

 

import Foundation
import ThreemaFramework
@testable import Threema

/// A configurable implementation of `LicenseStoreAdapterProtocol` for testing
///
/// Credentials are written to ``licenseStoreMock``, so tests can assert what a license activation
/// link stored.
@MainActor
final class LicenseStoreAdapterMock: LicenseStoreAdapterProtocol {

    // MARK: - Store

    let licenseStoreMock = LicenseStoreMock()

    var store: any LicenseStoreProtocol {
        licenseStoreMock
    }

    var licenseUsername: String? {
        get { licenseStoreMock.licenseUsername }
        set { licenseStoreMock.licenseUsername = newValue }
    }

    var licensePassword: String? {
        get { licenseStoreMock.licensePassword }
        set { licenseStoreMock.licensePassword = newValue }
    }

    var licenseDeviceID: String? {
        get { licenseStoreMock.licenseDeviceID }
        set { licenseStoreMock.licenseDeviceID = newValue ?? String() }
    }

    var onPremConfigURL: String? {
        get { licenseStoreMock.onPremConfigURL }
        set { licenseStoreMock.onPremConfigURL = newValue }
    }

    // MARK: - Configurable behavior

    var isValid = false

    /// Result of ``performLicenseCheck()``, ignored if ``performLicenseCheckHandler`` is set
    var performLicenseCheckResult = true

    /// Called for every ``performLicenseCheck()`` with the number of the call, starting at 1
    var performLicenseCheckHandler: ((Int) async -> Bool)?

    // MARK: - Call tracking

    private(set) var performLicenseCheckCount = 0
    private(set) var performUpdateWorkInfoCount = 0

    // MARK: - LicenseStoreAdapterProtocol

    func performLicenseCheck() async -> Bool {
        performLicenseCheckCount += 1

        guard let performLicenseCheckHandler else {
            return performLicenseCheckResult
        }

        return await performLicenseCheckHandler(performLicenseCheckCount)
    }

    func performUpdateWorkInfo() {
        performUpdateWorkInfoCount += 1
    }
}

Messung
CHZG
869710094

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© 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.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=1104850
#Domains=416977