EscapeForCql() public static method

Escapse the provided string for use with CQL.
public static EscapeForCql ( string value ) : string
value string The string value to escape.
return string
Ejemplo n.º 1
0
        public void EscapeForCqlTest()
        {
            // arrange
            var expected = "My''Test''Data";

            // act
            var actual = CqlHelper.EscapeForCql("My'Test'Data");

            // assert
            Assert.Equal(expected, actual);
        }
Ejemplo n.º 2
0
        public void EscapeBytesForCqlTest()
        {
            //arrange
            var bytes       = Encoding.UTF8.GetBytes("hello world");
            var expectedHex = "0x68656c6c6f20776f726c64"; //generated via the textAsBlob function in CQL3 shell

            //act
            var hex = CqlHelper.EscapeForCql(bytes);

            //assert
            Assert.Equal(expectedHex, hex);
        }