Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
StackExchange.Redis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
StackExchange.Redis
Commits
c7276c23
Commit
c7276c23
authored
Feb 27, 2020
by
mgravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix some copy options re unknown indexes
parent
026476df
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
ClientTest.cs
tests/NRediSearch.Test/ClientTests/ClientTest.cs
+6
-2
RediSearchTestBase.cs
tests/NRediSearch.Test/RediSearchTestBase.cs
+9
-1
No files found.
tests/NRediSearch.Test/ClientTests/ClientTest.cs
View file @
c7276c23
...
@@ -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
]
...
...
tests/NRediSearch.Test/RediSearchTestBase.cs
View file @
c7276c23
...
@@ -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
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment