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(); }); }
public void PutKeyNullKeyAsyncTest() { TestUtilities.AsyncTestWrapper(TestContext, () => { var target = new KeyFile(); target.PutKeyAsync(null, "foo.key").Wait(); Assert.IsFalse(File.Exists("foo.key")); }); }
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"); }
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"); }); }