Commit 9c830b62 authored by Andrew's avatar Andrew

Fix ToString of LengthCondition

parent b17d62d9
......@@ -346,14 +346,17 @@ public void BasicTranWithStringLengthCondition(string value, ComparisonType type
case ComparisonType.Equal:
expectSuccess = valueLength == length;
condition = Condition.StringLengthEqual(key2, length);
Assert.That(condition.ToString(), Contains.Substring("String length == " + length));
break;
case ComparisonType.GreaterThan:
expectSuccess = valueLength > length;
condition = Condition.StringLengthGreaterThan(key2, length);
Assert.That(condition.ToString(), Contains.Substring("String length > " + length));
break;
case ComparisonType.LessThan:
expectSuccess = valueLength < length;
condition = Condition.StringLengthLessThan(key2, length);
Assert.That(condition.ToString(), Contains.Substring("String length < " + length));
break;
}
......
......@@ -502,7 +502,7 @@ public LengthCondition(RedisKey key, RedisType type, int compareToResult, long e
this.key = key;
this.compareToResult = compareToResult;
this.expectedLength = expectedLength;
this.type = type;
switch (type) {
case RedisType.Hash:
cmd = RedisCommand.HLEN;
......@@ -536,7 +536,7 @@ public override string ToString()
private string GetComparisonString()
{
return compareToResult == 0 ? " == " : (compareToResult < 0 ? " < " : " > ");
return compareToResult == 0 ? " == " : (compareToResult < 0 ? " > " : " < ");
}
internal override void CheckCommands(CommandMap commandMap)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment