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
4626b120
Commit
4626b120
authored
Oct 10, 2014
by
olviko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
HLL unit tests
parent
b93613e8
Changes
2
Hide 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 @
4626b120
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 @
4626b120
...
...
@@ -66,6 +66,7 @@
<ItemGroup>
<Compile
Include=
"AsyncTests.cs"
/>
<Compile
Include=
"BasicOps.cs"
/>
<Compile
Include=
"HyperLogLog.cs"
/>
<Compile
Include=
"WrapperBaseTests.cs"
/>
<Compile
Include=
"TransactionWrapperTests.cs"
/>
<Compile
Include=
"Bits.cs"
/>
...
...
@@ -128,11 +129,11 @@
</ProjectReference>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
\ No newline at end of file
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