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
6718f8a9
Commit
6718f8a9
authored
Apr 24, 2014
by
Marc Gravell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue 25: improved handling of configuration strings
parent
59e54f53
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
208 additions
and
119 deletions
+208
-119
AsyncTests.cs
StackExchange.Redis.Tests/AsyncTests.cs
+1
-1
BasicOps.cs
StackExchange.Redis.Tests/BasicOps.cs
+2
-2
Commands.cs
StackExchange.Redis.Tests/Commands.cs
+1
-0
Issue25.cs
StackExchange.Redis.Tests/Issues/Issue25.cs
+37
-0
StackExchange.Redis.Tests.csproj
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
+1
-0
ConfigurationOptions.cs
...xchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
+166
-116
No files found.
StackExchange.Redis.Tests/AsyncTests.cs
View file @
6718f8a9
...
...
@@ -42,7 +42,7 @@ public void AsyncTasksReportFailureIfServerUnavailable()
Assert
.
IsTrue
(
c
.
IsFaulted
,
"faulted"
);
var
ex
=
c
.
Exception
.
InnerExceptions
.
Single
();
Assert
.
IsInstanceOf
<
RedisConnectionException
>(
ex
);
Assert
.
AreEqual
(
"No connection is available to service this operation: SADD"
,
ex
.
Message
);
Assert
.
AreEqual
(
"No connection is available to service this operation: SADD
AsyncTasksReportFailureIfServerUnavailable
"
,
ex
.
Message
);
}
}
#endif
...
...
StackExchange.Redis.Tests/BasicOps.cs
View file @
6718f8a9
...
...
@@ -293,7 +293,7 @@ public void GetWithExpiry(bool exists, bool hasExpiry)
}
}
[
Test
]
[
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"
ERR
Operation against a key holding the wrong kind of value"
)]
[
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"
WRONGTYPE
Operation against a key holding the wrong kind of value"
)]
public
void
GetWithExpiryWrongTypeAsync
()
{
using
(
var
conn
=
Create
())
...
...
@@ -315,7 +315,7 @@ public void GetWithExpiryWrongTypeAsync()
}
[
Test
]
[
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"
ERR
Operation against a key holding the wrong kind of value"
)]
[
ExpectedException
(
typeof
(
RedisServerException
),
ExpectedMessage
=
"
WRONGTYPE
Operation against a key holding the wrong kind of value"
)]
public
void
GetWithExpiryWrongTypeSync
()
{
using
(
var
conn
=
Create
())
...
...
StackExchange.Redis.Tests/Commands.cs
View file @
6718f8a9
...
...
@@ -11,6 +11,7 @@ public void Basic()
{
var
config
=
ConfigurationOptions
.
Parse
(
".,$PING=p"
);
Assert
.
AreEqual
(
1
,
config
.
EndPoints
.
Count
);
config
.
SetDefaultPorts
();
Assert
.
Contains
(
new
DnsEndPoint
(
"."
,
6379
),
config
.
EndPoints
);
var
map
=
config
.
CommandMap
;
Assert
.
AreEqual
(
"$PING=p"
,
map
.
ToString
());
...
...
StackExchange.Redis.Tests/Issues/Issue25.cs
0 → 100644
View file @
6718f8a9
using
NUnit.Framework
;
using
System
;
namespace
StackExchange.Redis.Tests.Issues
{
[
TestFixture
]
public
class
Issue25
:
TestBase
{
[
Test
]
public
void
CaseInsensitive
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"ssl=true"
);
Assert
.
IsTrue
(
options
.
Ssl
);
Assert
.
AreEqual
(
"ssl=True"
,
options
.
ToString
());
options
=
ConfigurationOptions
.
Parse
(
"SSL=TRUE"
);
Assert
.
IsTrue
(
options
.
Ssl
);
Assert
.
AreEqual
(
"ssl=True"
,
options
.
ToString
());
}
[
Test
]
public
void
UnkonwnKeywordHandling_Ignore
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"ssl2=true"
,
true
);
}
[
Test
,
ExpectedException
(
typeof
(
ArgumentException
),
ExpectedMessage
=
"Keyword 'ssl2' is not supported"
)]
public
void
UnkonwnKeywordHandling_ExplicitFail
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"ssl2=true"
,
false
);
}
[
Test
,
ExpectedException
(
typeof
(
ArgumentException
),
ExpectedMessage
=
"Keyword 'ssl2' is not supported"
)]
public
void
UnkonwnKeywordHandling_ImplicitFail
()
{
var
options
=
ConfigurationOptions
.
Parse
(
"ssl2=true"
);
}
}
}
StackExchange.Redis.Tests/StackExchange.Redis.Tests.csproj
View file @
6718f8a9
...
...
@@ -72,6 +72,7 @@
<Compile
Include=
"Config.cs"
/>
<Compile
Include=
"FloatingPoint.cs"
/>
<Compile
Include=
"Issues\BGSAVEResponse.cs"
/>
<Compile
Include=
"Issues\Issue25.cs"
/>
<Compile
Include=
"Issues\Issue6.cs"
/>
<Compile
Include=
"Issues\SO22786599.cs"
/>
<Compile
Include=
"Keys.cs"
/>
...
...
StackExchange.Redis/StackExchange/Redis/ConfigurationOptions.cs
View file @
6718f8a9
This diff is collapsed.
Click to expand it.
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