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
d2a8296d
Commit
d2a8296d
authored
Jun 29, 2018
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
don't use "foo" as a key name...
parent
dc589e4f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
Constraints.cs
StackExchange.Redis.Tests/Booksleeve/Constraints.cs
+9
-7
No files found.
StackExchange.Redis.Tests/Booksleeve/Constraints.cs
View file @
d2a8296d
using
System.Threading.Tasks
;
using
System.Runtime.CompilerServices
;
using
System.Threading.Tasks
;
using
Xunit
;
using
Xunit
;
using
Xunit.Abstractions
;
using
Xunit.Abstractions
;
...
@@ -15,24 +16,25 @@ public void ValueEquals()
...
@@ -15,24 +16,25 @@ public void ValueEquals()
Assert
.
True
(
x
.
Equals
(
y
),
"equals"
);
Assert
.
True
(
x
.
Equals
(
y
),
"equals"
);
Assert
.
True
(
x
==
y
,
"operator"
);
Assert
.
True
(
x
==
y
,
"operator"
);
}
}
static
RedisKey
Me
([
CallerMemberName
]
string
caller
=
null
)
=>
caller
;
[
Fact
]
[
Fact
]
public
void
TestManualIncr
()
public
void
TestManualIncr
()
{
{
using
(
var
muxer
=
GetUnsecuredConnection
(
syncTimeout
:
120000
))
// big timeout while debugging
using
(
var
muxer
=
GetUnsecuredConnection
(
syncTimeout
:
120000
))
// big timeout while debugging
{
{
var
key
=
Me
();
var
conn
=
muxer
.
GetDatabase
(
0
);
var
conn
=
muxer
.
GetDatabase
(
0
);
for
(
int
i
=
0
;
i
<
200
;
i
++)
for
(
int
i
=
0
;
i
<
200
;
i
++)
{
{
conn
.
KeyDelete
(
"foo"
);
conn
.
KeyDelete
(
key
);
Assert
.
Equal
(
1
,
conn
.
Wait
(
ManualIncr
(
conn
,
"foo"
)));
Assert
.
Equal
(
1
,
conn
.
Wait
(
ManualIncr
(
conn
,
key
)));
Assert
.
Equal
(
2
,
conn
.
Wait
(
ManualIncr
(
conn
,
"foo"
)));
Assert
.
Equal
(
2
,
conn
.
Wait
(
ManualIncr
(
conn
,
key
)));
Assert
.
Equal
(
2
,
(
long
)
conn
.
StringGet
(
"foo"
));
Assert
.
Equal
(
2
,
(
long
)
conn
.
StringGet
(
key
));
}
}
}
}
}
}
public
async
Task
<
long
?>
ManualIncr
(
IDatabase
connection
,
string
key
)
public
async
Task
<
long
?>
ManualIncr
(
IDatabase
connection
,
RedisKey
key
)
{
{
var
oldVal
=
(
long
?)
await
connection
.
StringGetAsync
(
key
).
ForAwait
();
var
oldVal
=
(
long
?)
await
connection
.
StringGetAsync
(
key
).
ForAwait
();
var
newVal
=
(
oldVal
??
0
)
+
1
;
var
newVal
=
(
oldVal
??
0
)
+
1
;
...
...
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