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

Cleanup: NRediSearch example usage

parent 09ca0fc4
...@@ -8,19 +8,21 @@ namespace NRediSearch.Test ...@@ -8,19 +8,21 @@ namespace NRediSearch.Test
{ {
public class ExampleUsage : IDisposable public class ExampleUsage : IDisposable
{ {
ConnectionMultiplexer conn; private ConnectionMultiplexer conn;
IDatabase db; private IDatabase db;
public ExampleUsage() public ExampleUsage()
{ {
conn = ConnectionMultiplexer.Connect("127.0.0.1:6379"); conn = ConnectionMultiplexer.Connect("127.0.0.1:6379");
db = conn.GetDatabase(); db = conn.GetDatabase();
} }
public void Dispose() public void Dispose()
{ {
conn?.Dispose(); conn?.Dispose();
conn = null; conn = null;
db = null; db = null;
} }
[Fact] [Fact]
public void BasicUsage() public void BasicUsage()
{ {
...@@ -67,9 +69,6 @@ public void BasicUsage() ...@@ -67,9 +69,6 @@ public void BasicUsage()
Assert.Equal("hello world", (string)item["title"]); Assert.Equal("hello world", (string)item["title"]);
Assert.Equal("lorem ipsum", (string)item["body"]); Assert.Equal("lorem ipsum", (string)item["body"]);
Assert.Equal(1337, (int)item["price"]); 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