Exemplo n.º 1
0
        public void TestCopy()
        {
            using (NativeRunner runner = new NativeRunner(HOST, PORT))
            {
                runner.PutBlob("blob", new byte[0]);
                Assert.IsTrue(runner.HasBlob("blob"));

                runner.CopyBlob2Blob("blob", "blob2");
                Assert.IsTrue(runner.HasBlob("blob2"));
                Assert.IsTrue(runner.HasBlob("blob"));

                runner.CopyBlob2File("blob2", "file");
                Assert.IsTrue(runner.HasBlob("blob2"));
                Assert.IsTrue(runner.HasFile("file"));

                runner.CopyFile2File("file", "file2");
                Assert.IsTrue(runner.HasFile("file2"));
                Assert.IsTrue(runner.HasFile("file"));

                runner.CopyFile2Blob("file2", "blob3");
                Assert.IsTrue(runner.HasBlob("blob3"));
                Assert.IsTrue(runner.HasFile("file2"));
            }
        }
Exemplo n.º 2
0
 public void TestPutGetFile()
 {
     using (NativeRunner runner = new NativeRunner(HOST, PORT))
     {
         string data = "Hello AK";
         runner.PutFile("data", Encoding.ASCII.GetBytes(data));
         Assert.IsTrue(runner.HasFile("data"));
         Assert.AreEqual(data, Encoding.ASCII.GetString(runner.GetFile("data")));
     }
 }
Exemplo n.º 3
0
        public void TestHas()
        {
            using (NativeRunner runner = new NativeRunner(HOST, PORT))
            {
                runner.PutBlob("blob", Encoding.ASCII.GetBytes("Hello"));
                Assert.IsTrue(runner.HasBlob("blob"));
                Assert.AreEqual("Hello", Encoding.ASCII.GetString(runner.GetBlob("blob")));

                runner.PutFile("file", Encoding.ASCII.GetBytes("Hello2"));
                Assert.IsTrue(runner.HasFile("file"));
                Assert.AreEqual("Hello2", Encoding.ASCII.GetString(runner.GetFile("file")));
            }
        }