Exemplo n.º 1
0
        public void CanDecryptReturnsTrueForExistingCrypto()
        {
            ICrypto fooCrypto = CreateICrypto("foo");
            ICrypto barCrypto = CreateICrypto("bar");

            var compositeCrypto = new CompositeCrypto(new List <ICrypto> {
                fooCrypto, barCrypto
            });

            compositeCrypto.CanDecrypt("foo").Should().BeTrue();
            compositeCrypto.CanDecrypt("bar").Should().BeTrue();
        }
Exemplo n.º 2
0
    public static void CanDecryptReturnsFalseForNonExistingCrypto()
    {
        var fooCrypto = CreateICrypto("foo");
        var barCrypto = CreateICrypto("bar");

        var compositeCrypto = new CompositeCrypto(new List <ICrypto> {
            fooCrypto, barCrypto
        });

        compositeCrypto.CanDecrypt("baz").Should().BeFalse();
    }