Commit 4626b120 authored by olviko's avatar olviko

HLL unit tests

parent b93613e8
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);
}
}
}
}
......@@ -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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment