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
c7cb6df9
Commit
c7cb6df9
authored
Mar 14, 2020
by
Nick Craver
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to illustrate #1133
parent
32c8667a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Hashes.cs
tests/StackExchange.Redis.Tests/Hashes.cs
+22
-0
No files found.
tests/StackExchange.Redis.Tests/Hashes.cs
View file @
c7cb6df9
...
...
@@ -573,5 +573,27 @@ public async Task TestGet()
Assert
.
Equal
(
"def"
,
result
[
"bar"
]);
}
}
[
Fact
]
public
async
Task
TestWhenAlwaysAsync
()
{
using
(
var
muxer
=
Create
())
{
var
conn
=
muxer
.
GetDatabase
();
var
hashkey
=
Me
();
conn
.
KeyDelete
(
hashkey
,
CommandFlags
.
FireAndForget
);
var
result1
=
await
conn
.
HashSetAsync
(
hashkey
,
"foo"
,
"bar"
,
When
.
Always
,
CommandFlags
.
None
);
var
result2
=
await
conn
.
HashSetAsync
(
hashkey
,
"foo2"
,
"bar"
,
When
.
Always
,
CommandFlags
.
None
);
var
result3
=
await
conn
.
HashSetAsync
(
hashkey
,
"foo"
,
"bar"
,
When
.
Always
,
CommandFlags
.
None
);
var
result4
=
await
conn
.
HashSetAsync
(
hashkey
,
"foo"
,
"bar2"
,
When
.
Always
,
CommandFlags
.
None
);
Assert
.
True
(
result1
,
"Initial set key 1"
);
Assert
.
True
(
result2
,
"Initial set key 2"
);
// Fields modified *but not added* should be a zero/false. That's the behavior of HSET
Assert
.
False
(
result3
,
"Duplicate set key 1"
);
Assert
.
False
(
result4
,
"Duplicate se key 1 variant"
);
}
}
}
}
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