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
e9df673f
Commit
e9df673f
authored
Oct 10, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #103 from olviko/master
HLL unit tests
parents
de68ab63
4626b120
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
52 additions
and
6 deletions
+52
-6
HyperLogLog.cs
StackExchange.Redis.Tests/HyperLogLog.cs
+45
-0
StackExchange.Redis.Tests.csproj
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
+7
-6
No files found.
StackExchange.Redis.Tests/HyperLogLog.cs
0 → 100644
View file @
e9df673f
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
using
NUnit.Framework
;
namespace
StackExchange.Redis.Tests
{
[
TestFixture
]
public
class
HyperLogLog
:
TestBase
{
[
Test
]
public
void
SingleKeyLength
()
{
using
(
var
conn
=
Create
())
{
var
db
=
conn
.
GetDatabase
();
RedisKey
key
=
"hll1"
;
db
.
HyperLogLogAdd
(
key
,
"a"
);
db
.
HyperLogLogAdd
(
key
,
"b"
);
db
.
HyperLogLogAdd
(
key
,
"c"
);
Assert
.
IsTrue
(
db
.
HyperLogLogLength
(
key
)
>
0
);
}
}
[
Test
]
public
void
MultiKeyLength
()
{
using
(
var
conn
=
Create
(
useSharedSocketManager
:
true
))
{
var
db
=
conn
.
GetDatabase
();
RedisKey
[]
keys
=
{
"hll1"
,
"hll2"
,
"hll3"
};
db
.
HyperLogLogAdd
(
keys
[
0
],
"a"
);
db
.
HyperLogLogAdd
(
keys
[
1
],
"b"
);
db
.
HyperLogLogAdd
(
keys
[
2
],
"c"
);
Assert
.
IsTrue
(
db
.
HyperLogLogLength
(
keys
)
>
0
);
}
}
}
}
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
View file @
e9df673f
...
@@ -66,6 +66,7 @@
...
@@ -66,6 +66,7 @@
<ItemGroup>
<ItemGroup>
<Compile
Include=
"AsyncTests.cs"
/>
<Compile
Include=
"AsyncTests.cs"
/>
<Compile
Include=
"BasicOps.cs"
/>
<Compile
Include=
"BasicOps.cs"
/>
<Compile
Include=
"HyperLogLog.cs"
/>
<Compile
Include=
"WrapperBaseTests.cs"
/>
<Compile
Include=
"WrapperBaseTests.cs"
/>
<Compile
Include=
"TransactionWrapperTests.cs"
/>
<Compile
Include=
"TransactionWrapperTests.cs"
/>
<Compile
Include=
"Bits.cs"
/>
<Compile
Include=
"Bits.cs"
/>
...
...
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