Ejemplo n.º 1
0
        public async Task CreateAndDeleteTest()
        {
            string path = $"/async{Guid.NewGuid()}";

            using (ZooKeeper zk = CreateClient())
            {
                await zk.CreateAsync(path, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.Persistent);

                Assert.That(await zk.ExistsAsync(path, false), Is.Not.Null);
                await zk.DeleteAsync(path, -1);

                Assert.That(await zk.ExistsAsync(path, false), Is.Null);
            }
        }
Ejemplo n.º 2
0
        public void TimeoutExceptionTest()
        {
            string path = $"/asynctimeout{Guid.NewGuid()}";

            using (ZooKeeper zk = CreateClient(new TimeSpan(1)))
            {
                Assert.That(async() => await zk.ExistsAsync(path, false), Throws.Exception.TypeOf <TimeoutException>());
            }
        }