Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit c3e0995

Browse files
committed
Add password config tests
1 parent ab57d9d commit c3e0995

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using NUnit.Framework;
2+
3+
namespace ServiceStack.Redis.Tests.Issues
4+
{
5+
public class ConnectionStringConfigIssues
6+
{
7+
[Test]
8+
public void Can_use_password_with_equals()
9+
{
10+
var connString = "127.0.0.1?password=" + "p@55w0rd=".UrlEncode();
11+
12+
var config = connString.ToRedisEndpoint();
13+
Assert.That(config.Password, Is.EqualTo("p@55w0rd="));
14+
}
15+
16+
[Test, Ignore("Requires redis-server configured with 'requirepass p@55w0rd='")]
17+
public void Can_connect_to_redis_with_password_with_equals()
18+
{
19+
var connString = "127.0.0.1?password=" + "p@55w0rd=".UrlEncode();
20+
var redisManager = new PooledRedisClientManager(connString);
21+
using (var redis = redisManager.GetClient())
22+
{
23+
Assert.That(redis.Password, Is.EqualTo("p@55w0rd="));
24+
}
25+
}
26+
}
27+
}

0 commit comments

Comments
 (0)