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

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encrypted = asyncCrypto.DecryptAsync(new byte[0], "foo", default(CancellationToken)).Result;

            Assert.That(encrypted, Is.EqualTo(Encoding.UTF8.GetBytes("foo")));
        }
        public void DecryptAsync_string_ReturnsACompletedTask()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encryptTask = asyncCrypto.DecryptAsync("stuff", "foo", default(CancellationToken));

            Assert.That(encryptTask.IsCompleted, Is.True);
        }
        public void DecryptAsync_string_ReturnsTheResultReturnedByCryptoEncrypt()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encrypted = asyncCrypto.DecryptAsync("stuff", "foo", default(CancellationToken)).Result;

            Assert.That(encrypted, Is.EqualTo("DecryptedString : foo"));
        }
Beispiel #4
0
        public void DecryptAsync_string_ReturnsACompletedTask()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encryptTask = asyncCrypto.DecryptAsync("stuff", "foo");

            Assert.IsTrue(encryptTask.IsCompleted);
        }
Beispiel #5
0
        public void DecryptAsync_bytearray_ReturnsTheResultReturnedByCryptoEncrypt()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encrypted = asyncCrypto.DecryptAsync(new byte[0], "foo").Result;

            //Assert.AreEqual(encrypted, Encoding.UTF8.GetBytes("foo"));
        }
Beispiel #6
0
        public void DecryptAsync_bytearray_ReturnsACompletedTask()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encryptTask = asyncCrypto.DecryptAsync(new byte[0], "foo");

            Assert.IsTrue(encryptTask.IsCompleted);
        }
Beispiel #7
0
        public void DecryptAsync_string_ReturnsTheResultReturnedByCryptoEncrypt()
        {
            Setup("foo");

            var asyncCrypto = new SynchronousAsyncCrypto(_cryptoMock.Object);

            var encrypted = asyncCrypto.DecryptAsync("stuff", "foo").Result;

            Assert.AreEqual(encrypted, "DecryptedString : foo");
        }