当前位置: 首页>>代码示例>>C#>>正文


C# Processor.ProcessCommand方法代码示例

本文整理汇总了C#中Processor.ProcessCommand方法的典型用法代码示例。如果您正苦于以下问题:C# Processor.ProcessCommand方法的具体用法?C# Processor.ProcessCommand怎么用?C# Processor.ProcessCommand使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Processor的用法示例。


在下文中一共展示了Processor.ProcessCommand方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProcessTwoSetKeyValues

 public void ProcessTwoSetKeyValues()
 {
     Processor processor = new Processor(this.repository, "set users:1:age 800\nset users:1:height 180");
     Assert.IsFalse(processor.ProcessCommand().HasValue);
     Assert.IsFalse(processor.ProcessCommand().HasValue);
     Assert.AreEqual(800ul, this.repository.GetValue("users:1:age"));
     Assert.AreEqual(180ul, this.repository.GetValue("users:1:height"));
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:8,代码来源:ProcessorTests.cs

示例2: RaiseWhenSetCommandHasManyValues

 public void RaiseWhenSetCommandHasManyValues()
 {
     Processor processor = new Processor(this.repository, "set counter 1 2");
     processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例3: RaiseWhenGetCommandHasParameter

 public void RaiseWhenGetCommandHasParameter()
 {
     Processor processor = new Processor(this.repository, "get counter 1");
     processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例4: RaiseWhenCommandHasNoKey

 public void RaiseWhenCommandHasNoKey()
 {
     Processor processor = new Processor(this.repository, "get");
     processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例5: RaiseWhenCommandHasAVerbThatIsNotAName

 public void RaiseWhenCommandHasAVerbThatIsNotAName()
 {
     Processor processor = new Processor(this.repository, "1 2 3");
     processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例6: RaisesIfUnknownVerb

 public void RaisesIfUnknownVerb()
 {
     Processor processor = new Processor(this.repository, "foo key value");
     CommandResult result = processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例7: RaisesIfInvalidArity

 public void RaisesIfInvalidArity()
 {
     Processor processor = new Processor(this.repository, "set users:1:name");
     CommandResult result = processor.ProcessCommand();
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:5,代码来源:ProcessorTests.cs

示例8: ProcessSetKeyValue

 public void ProcessSetKeyValue()
 {
     Processor processor = new Processor(this.repository, "set counter 1");
     Assert.IsFalse(processor.ProcessCommand().HasValue);
     Assert.AreEqual(1ul, this.repository.GetValue("counter"));
 }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:6,代码来源:ProcessorTests.cs

示例9: SetIsStringMemberOnEmptySet

        public void SetIsStringMemberOnEmptySet()
        {
            for (int k = 1; k <= 1000; k++)
            {
                string command = string.Format("sismember users:1:followers \"user{0}\"", 1);
                Processor processor = new Processor(this.repository, new StringReader(command));
                CommandResult result = processor.ProcessCommand();

                Assert.IsNotNull(result);
                Assert.IsTrue(result.HasValue);
                Assert.AreEqual(false, result.Value);
            }
        }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:13,代码来源:ProcessorTests.cs

示例10: SetAndGetOneThousandUsers

        public void SetAndGetOneThousandUsers()
        {
            for (int k = 1; k <= 1000; k++)
            {
                Processor processor = new Processor(this.repository, string.Format("set users:{0}:age {0}\nset users:{0}:id {0}", k));
                Assert.IsFalse(processor.ProcessCommand().HasValue);
                Assert.IsFalse(processor.ProcessCommand().HasValue);
            }

            for (int k = 1; k <= 1000; k++)
            {
                Processor processor = new Processor(this.repository, string.Format("get users:{0}:age\nget users:{0}:id", k));
                Assert.AreEqual((ulong)k, processor.ProcessCommand().Value);
                Assert.AreEqual((ulong)k, processor.ProcessCommand().Value);
            }
        }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:16,代码来源:ProcessorTests.cs

示例11: SetAddRemoveAndIsMemberString

        public void SetAddRemoveAndIsMemberString()
        {
            string command = string.Format("sadd users:1:followers \"user{0}\"\r\nsrem users:1:followers \"user{0}\"\r\nsismember users:1:followers \"user{0}\"", 1);
            Processor processor = new Processor(this.repository, new StringReader(command));
            processor.ProcessCommand();
            processor.ProcessCommand();
            CommandResult result = processor.ProcessCommand();

            Assert.IsNotNull(result);
            Assert.IsTrue(result.HasValue);
            Assert.AreEqual(false, result.Value);
        }
开发者ID:ajlopez,项目名称:AjKeyvs,代码行数:12,代码来源:ProcessorTests.cs


注:本文中的Processor.ProcessCommand方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。