Beispiel #1
0
    public void NoPassphraseIfDialogIsNotAvailable()
    {
        IPassphraseProvider sut = new PassphraseProvider();
        var actualPassphrase    = sut.Passphrase(PassphraseGuid, Title, Description, () => null);

        Assert.AreEqual("", actualPassphrase);
    }
Beispiel #2
0
    public void PassphraseIsEmptyIfDialogFails()
    {
        IPassphraseProvider sut = new PassphraseProvider();
        var actualPassphrase    = sut.Passphrase(PassphraseGuid, Title, Description, FailedPassphraseDialog);

        Assert.AreEqual("", actualPassphrase);
    }
Beispiel #3
0
    public void CanProvidePassphrase()
    {
        IPassphraseProvider sut = new PassphraseProvider();
        var actualPassphrase    = sut.Passphrase(PassphraseGuid, Title, Description, SuccessfulPassphraseDialog);

        Assert.AreEqual(ExpectedPassphrase, actualPassphrase);
    }
Beispiel #4
0
    public void NoPassphraseAfterCacheIsCleared()
    {
        IPassphraseProvider sut = new PassphraseProvider();
        var actualPassphrase    = sut.Passphrase(PassphraseGuid, Title, Description, SuccessfulPassphraseDialog);

        Assert.AreEqual(ExpectedPassphrase, actualPassphrase);
        PassphraseProvider.Passphrases.Clear();
        actualPassphrase = sut.Passphrase(PassphraseGuid, Title, Description, FailedPassphraseDialog);
        Assert.AreEqual("", actualPassphrase);
    }