Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
9c830b62
Commit
9c830b62
authored
Apr 04, 2016
by
Andrew
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ToString of LengthCondition
parent
b17d62d9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
2 deletions
+5
-2
Transactions.cs
StackExchange.Redis.Tests/Transactions.cs
+3
-0
Condition.cs
StackExchange.Redis/StackExchange/Redis/Condition.cs
+2
-2
No files found.
StackExchange.Redis.Tests/Transactions.cs
View file @
9c830b62
...
...
@@ -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
;
}
...
...
StackExchange.Redis/StackExchange/Redis/Condition.cs
View file @
9c830b62
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment