Commit 265383b1 authored by Nick Craver's avatar Nick Craver

Cleanup: NRediSearch example usage

parent 09ca0fc4
......@@ -8,19 +8,21 @@ namespace NRediSearch.Test
{
public class ExampleUsage : IDisposable
{
ConnectionMultiplexer conn;
IDatabase db;
private ConnectionMultiplexer conn;
private IDatabase db;
public ExampleUsage()
{
conn = ConnectionMultiplexer.Connect("127.0.0.1:6379");
db = conn.GetDatabase();
}
public void Dispose()
{
conn?.Dispose();
conn = null;
db = null;
}
[Fact]
public void BasicUsage()
{
......@@ -33,7 +35,7 @@ public void BasicUsage()
.AddTextField("title", 5.0)
.AddTextField("body", 1.0)
.AddNumericField("price");
Assert.True(client.CreateIndex(sc, Client.IndexOptions.Default));
// note: using java API equivalent here; it would be nice to
......@@ -67,9 +69,6 @@ public void BasicUsage()
Assert.Equal("hello world", (string)item["title"]);
Assert.Equal("lorem ipsum", (string)item["body"]);
Assert.Equal(1337, (int)item["price"]);
}
}
}
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