Пример #1
0
        public void PutKeyBlankLocationAsyncTest()
        {
            TestUtilities.AsyncTestWrapper(TestContext, () =>
            {
                var target = new KeyFile();

                target.PutKeyAsync(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, " \t").Wait();
            });
        }
Пример #2
0
        public void PutKeyNullKeyAsyncTest()
        {
            TestUtilities.AsyncTestWrapper(TestContext, () =>
            {
                var target = new KeyFile();

                target.PutKeyAsync(null, "foo.key").Wait();
                Assert.IsFalse(File.Exists("foo.key"));
            });
        }
Пример #3
0
        public void PutKeyAsyncTest()
        {
            File.Delete("foo.key");

            var target = new KeyFile();

            target.PutKeyAsync(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "foo.key").Wait();

            Assert.IsTrue(File.Exists("foo.key"));

            File.Delete("foo.key");
        }
Пример #4
0
        public void GetKeyAsyncTest()
        {
            TestUtilities.AsyncTestWrapper(TestContext, () =>
            {
                File.Delete("foo.key");

                var target = new KeyFile();

                target.PutKeyAsync(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }, "foo.key").Wait();

                Assert.IsTrue(File.Exists("foo.key"));

                var key = target.GetKeyAsync("foo.key").Result;

                Assert.IsNotNull(key);
                Assert.IsTrue(key.SequenceEqual(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }));

                File.Delete("foo.key");
            });
        }