Commit 78e430a6 authored by Nick Craver's avatar Nick Craver

NRedisSearch: don't throw for everyone who doesn't have the module

TODO: inherit from tests project and use a proper Skip.
parent 9dc6dd2d
...@@ -36,7 +36,23 @@ public void BasicUsage() ...@@ -36,7 +36,23 @@ public void BasicUsage()
.AddTextField("body", 1.0) .AddTextField("body", 1.0)
.AddNumericField("price"); .AddNumericField("price");
Assert.True(client.CreateIndex(sc, Client.IndexOptions.Default)); bool result = false;
try
{
result = client.CreateIndex(sc, Client.IndexOptions.Default);
}
catch (RedisServerException ex)
{
// TODO: Convert to Skip
if (ex.Message == "ERR unknown command 'FT.CREATE'")
{
Console.WriteLine(ex.Message);
Console.WriteLine("Module not installed, aborting");
return; // the module isn't installed
}
}
Assert.True(result);
// note: using java API equivalent here; it would be nice to // note: using java API equivalent here; it would be nice to
// use meta-programming / reflection instead in .NET // use meta-programming / reflection instead in .NET
......
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