Commit c7276c23 authored by mgravell's avatar mgravell

fix some copy options re unknown indexes

parent 026476df
...@@ -50,7 +50,9 @@ public void Search() ...@@ -50,7 +50,9 @@ public void Search()
Assert.True(cl.DropIndex()); Assert.True(cl.DropIndex());
var ex = Assert.Throws<RedisServerException>(() => cl.Search(new Query("hello world"))); var ex = Assert.Throws<RedisServerException>(() => cl.Search(new Query("hello world")));
Assert.Equal("Unknown Index name", ex.Message, ignoreCase: true); Assert.True(
string.Equals("Unknown Index name", ex.Message, System.StringComparison.InvariantCultureIgnoreCase)
|| string.Equals("no such index", ex.Message, System.StringComparison.InvariantCultureIgnoreCase));
} }
[Fact] [Fact]
...@@ -557,7 +559,9 @@ public void TestDropMissing() ...@@ -557,7 +559,9 @@ public void TestDropMissing()
{ {
Client cl = GetClient(); Client cl = GetClient();
var ex = Assert.Throws<RedisServerException>(() => cl.DropIndex()); var ex = Assert.Throws<RedisServerException>(() => cl.DropIndex());
Assert.Equal("Unknown Index name", ex.Message, ignoreCase: true); Assert.True(
string.Equals("Unknown Index name", ex.Message, System.StringComparison.InvariantCultureIgnoreCase)
|| string.Equals("no such index", ex.Message, System.StringComparison.InvariantCultureIgnoreCase));
} }
[Fact] [Fact]
......
...@@ -38,7 +38,15 @@ protected static Client Reset(Client client) ...@@ -38,7 +38,15 @@ protected static Client Reset(Client client)
} }
catch (RedisServerException ex) catch (RedisServerException ex)
{ {
if (!string.Equals(ex.Message, "Unknown Index name", StringComparison.OrdinalIgnoreCase)) throw; if (string.Equals("Unknown Index name", ex.Message, System.StringComparison.InvariantCultureIgnoreCase)
|| string.Equals("no such index", ex.Message, System.StringComparison.InvariantCultureIgnoreCase))
{
// fine
}
else
{
throw;
}
} }
return client; return client;
} }
......
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