本文整理汇总了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"));
}
示例2: RaiseWhenSetCommandHasManyValues
public void RaiseWhenSetCommandHasManyValues()
{
Processor processor = new Processor(this.repository, "set counter 1 2");
processor.ProcessCommand();
}
示例3: RaiseWhenGetCommandHasParameter
public void RaiseWhenGetCommandHasParameter()
{
Processor processor = new Processor(this.repository, "get counter 1");
processor.ProcessCommand();
}
示例4: RaiseWhenCommandHasNoKey
public void RaiseWhenCommandHasNoKey()
{
Processor processor = new Processor(this.repository, "get");
processor.ProcessCommand();
}
示例5: RaiseWhenCommandHasAVerbThatIsNotAName
public void RaiseWhenCommandHasAVerbThatIsNotAName()
{
Processor processor = new Processor(this.repository, "1 2 3");
processor.ProcessCommand();
}
示例6: RaisesIfUnknownVerb
public void RaisesIfUnknownVerb()
{
Processor processor = new Processor(this.repository, "foo key value");
CommandResult result = processor.ProcessCommand();
}
示例7: RaisesIfInvalidArity
public void RaisesIfInvalidArity()
{
Processor processor = new Processor(this.repository, "set users:1:name");
CommandResult result = processor.ProcessCommand();
}
示例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"));
}
示例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);
}
}
示例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);
}
}
示例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);
}