Ejemplo n.º 1
0
        public async Task TestCellsDeletion()
        {
            const string testKey = "content";
            const string testValue = "the force is strong in this column";
            var client = new HBaseClient(_credentials);
            var set = new CellSet();
            var row = new CellSet.Row { key = Encoding.UTF8.GetBytes(testKey) };
            set.rows.Add(row);

            var value = new Cell { column = Encoding.UTF8.GetBytes("d:starwars"), data = Encoding.UTF8.GetBytes(testValue) };
            row.values.Add(value);

            client.StoreCells(_testTableName, set);
            CellSet cell = await client.GetCellsAsync(_testTableName, testKey);
            // make sure the cell is in the table
            Assert.AreEqual(Encoding.UTF8.GetString(cell.rows[0].key), testKey);
            // delete cell
            await client.DeleteCellsAsync(_testTableName, testKey);
            // get cell again, 404 exception expected
            await client.GetCellsAsync(_testTableName, testKey);

        }