Exemple #1
0
        public void SimpleStatement_Bind_SetsRoutingValues_Single()
        {
            var stmt = new SimpleStatement(Query, "id1");

            Assert.Null(stmt.RoutingKey);
            stmt.SetRoutingValues("id1");
            stmt.Serializer = new Serializer(ProtocolVersion.MaxSupported);
            CollectionAssert.AreEqual(stmt.Serializer.Serialize("id1"), stmt.RoutingKey.RawRoutingKey);
        }
Exemple #2
0
        public void SimpleStatement_Bind_SetsRoutingValues_Single()
        {
            const int protocolVersion = 2;
            var       stmt            = new SimpleStatement(Query, "id1");

            Assert.Null(stmt.RoutingKey);
            stmt.SetRoutingValues("id1");
            stmt.ProtocolVersion = protocolVersion;
            CollectionAssert.AreEqual(TypeCodec.Encode(protocolVersion, "id1"), stmt.RoutingKey.RawRoutingKey);
        }
Exemple #3
0
        public void SimpleStatement_Bind_SetsRoutingValues_Multiple()
        {
            var stmt = new SimpleStatement(Query, "id1", "id2", "val1");

            Assert.Null(stmt.RoutingKey);
            stmt.SetRoutingValues("id1", "id2");
            stmt.Serializer = new Serializer(ProtocolVersion.MaxSupported);
            var expectedRoutingKey = new byte[0]
                                     .Concat(new byte[] { 0, 3 })
                                     .Concat(stmt.Serializer.Serialize("id1"))
                                     .Concat(new byte[] { 0 })
                                     .Concat(new byte[] { 0, 3 })
                                     .Concat(stmt.Serializer.Serialize("id2"))
                                     .Concat(new byte[] { 0 });

            CollectionAssert.AreEqual(expectedRoutingKey, stmt.RoutingKey.RawRoutingKey);
        }
Exemple #4
0
        public void SimpleStatement_Bind_SetsRoutingValues_Multiple()
        {
            const int protocolVersion = 2;
            var       stmt            = new SimpleStatement(Query, "id1", "id2", "val1");

            Assert.Null(stmt.RoutingKey);
            stmt.SetRoutingValues("id1", "id2");
            stmt.ProtocolVersion = protocolVersion;
            var expectedRoutingKey = new byte[0]
                                     .Concat(new byte[] { 0, 3 })
                                     .Concat(TypeCodec.Encode(protocolVersion, "id1"))
                                     .Concat(new byte[] { 0 })
                                     .Concat(new byte[] { 0, 3 })
                                     .Concat(TypeCodec.Encode(protocolVersion, "id2"))
                                     .Concat(new byte[] { 0 });

            CollectionAssert.AreEqual(expectedRoutingKey, stmt.RoutingKey.RawRoutingKey);
        }
 public void SimpleStatement_Bind_SetsRoutingValues_Multiple()
 {
     const int protocolVersion = 2;
     var stmt = new SimpleStatement(Query, "id1", "id2", "val1");
     Assert.Null(stmt.RoutingKey);
     stmt.SetRoutingValues("id1", "id2");
     stmt.ProtocolVersion = protocolVersion;
     var expectedRoutingKey = new byte[0]
         .Concat(new byte[] { 0, 3 })
         .Concat(TypeCodec.Encode(protocolVersion, "id1"))
         .Concat(new byte[] { 0 })
         .Concat(new byte[] { 0, 3 })
         .Concat(TypeCodec.Encode(protocolVersion, "id2"))
         .Concat(new byte[] { 0 });
     CollectionAssert.AreEqual(expectedRoutingKey, stmt.RoutingKey.RawRoutingKey);
 }
 public void SimpleStatement_Bind_SetsRoutingValues_Single()
 {
     const int protocolVersion = 2;
     var stmt = new SimpleStatement(Query, "id1");
     Assert.Null(stmt.RoutingKey);
     stmt.SetRoutingValues("id1");
     stmt.ProtocolVersion = protocolVersion;
     CollectionAssert.AreEqual(TypeCodec.Encode(protocolVersion, "id1"), stmt.RoutingKey.RawRoutingKey);
 }
 public void SimpleStatement_Bind_SetsRoutingValues_Single()
 {
     const int protocolVersion = 2;
     var stmt = new SimpleStatement(Query, "id1");
     Assert.Null(stmt.RoutingKey);
     stmt.SetRoutingValues("id1");
     stmt.Serializer = new Serializer(protocolVersion);
     CollectionAssert.AreEqual(stmt.Serializer.Serialize("id1"), stmt.RoutingKey.RawRoutingKey);
 }