public void CanEncrypt_ReturnsTheSameThingAsACallToCryptoCanEncrypt()
        {
            Setup("foo");

            Assume.That(_cryptoMock.Object.CanEncrypt("foo"), Is.True);
            Assume.That(_cryptoMock.Object.CanEncrypt("bar"), Is.False);

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            Assert.That(asyncCrypto.CanEncrypt("foo"), Is.True);
            Assert.That(asyncCrypto.CanEncrypt("bar"), Is.False);
        }
Esempio n. 2
0
        public void CanDecrypt_ReturnsTheSameThingAsACallToCryptoCanDecrypt()
        {
            Setup("foo");

            Assert.IsTrue(_cryptoMock.Object.CanEncrypt("foo"));
            Assert.IsFalse(_cryptoMock.Object.CanEncrypt("bar"));

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            Assert.IsTrue(asyncCrypto.CanEncrypt("foo"));
            Assert.IsFalse(asyncCrypto.CanEncrypt("bar"));
        }