Skip to content

Commit

Permalink
Match RediSearch 2.0 assumptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Craver committed Oct 24, 2020
1 parent 875eb2e commit edd87de
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/NRediSearch.Test/ClientTests/ClientTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,15 @@ public void TestAddHash()
Db.KeyDelete(hashKey);
Db.HashSet(hashKey, "title", "hello world");

Assert.True(cl.AddHash(hashKey, 1, false));
try
{
Assert.True(cl.AddHash(hashKey, 1, false));
}
catch (RedisServerException e)
{
Assert.StartsWith("ERR unknown command `FT.ADDHASH`", e.Message);
return; // Starting from RediSearch 2.0 this command is not supported anymore
}
SearchResult res = cl.Search(new Query("hello world").SetVerbatim());
Assert.Equal(1, res.TotalResults);
Assert.Equal(hashKey, res.Documents[0].Id);
Expand Down

0 comments on commit edd87de

Please sign in to comment.