public void When_Cloned_Expires_Is_Copied()
        {
            var op = new Increment("key", 1, 1, null, new DefaultTranscoder(), 1000)
            {
                Expires = 10
            };

            Assert.AreEqual(10, op.Expires);
            var cloned = op.Clone() as Increment;

            Assert.AreEqual(10, cloned.Expires);
        }
 public void Test_Clone()
 {
     var operation = new Increment("key", 1, 1, 0, GetVBucket(), Transcoder, OperationLifespanTimeout)
     {
         Cas = 1123
     };
     var cloned = operation.Clone();
     Assert.AreEqual(operation.CreationTime, cloned.CreationTime);
     Assert.AreEqual(operation.Cas, cloned.Cas);
     Assert.AreEqual(operation.VBucket.Index, cloned.VBucket.Index);
     Assert.AreEqual(operation.Key, cloned.Key);
     Assert.AreEqual(operation.Opaque, cloned.Opaque);
 }
示例#3
0
 public void Test_Clone()
 {
     var operation = new Increment("key", 1, 1, 0, GetVBucket(), Transcoder, OperationLifespanTimeout)
     {
         Cas = 1123
     };
     var cloned = operation.Clone();
     Assert.AreEqual(operation.CreationTime, cloned.CreationTime);
     Assert.AreEqual(operation.Cas, cloned.Cas);
     Assert.AreEqual(operation.VBucket.Index, cloned.VBucket.Index);
     Assert.AreEqual(operation.Key, cloned.Key);
     Assert.AreEqual(operation.Opaque, cloned.Opaque);
 }
        public override Statement Clone()
        {
            BlockStatement clonedBody = body != null?body.Clone() as BlockStatement : null;

            ForStatement result = new ForStatement(Initializer.Clone(), Condition.Clone(), Increment.Clone(), clonedBody);

            result.ConditionBlock = this.ConditionBlock;
            CopyParentAndLabel(result);
            return(result);
        }