1
1
using NUnit . Framework ;
2
+ using ServiceStack . Script ;
2
3
using ServiceStack . Templates ;
3
4
4
5
namespace ServiceStack . Redis . Tests
@@ -8,38 +9,38 @@ class RedisTemplateTests
8
9
[ Test ]
9
10
public void Does_build_connection_string ( )
10
11
{
11
- var context = new TemplateContext
12
+ var context = new ScriptContext
12
13
{
13
- TemplateFilters = { new TemplateRedisFilters ( ) }
14
+ ScriptMethods = { new RedisScripts ( ) }
14
15
} ;
15
16
context . Container . AddSingleton < IRedisClientsManager > ( ( ) => new RedisManagerPool ( ) ) ;
16
17
context . Init ( ) ;
17
18
18
- Assert . That ( context . EvaluateTemplate ( "{{ redisToConnectionString: host:7000?db=1 }}" ) ,
19
+ Assert . That ( context . EvaluateScript ( "{{ redisToConnectionString: host:7000?db=1 }}" ) ,
19
20
Is . EqualTo ( "host:7000?db=1" ) ) ;
20
21
21
- Assert . That ( context . EvaluateTemplate ( "{{ { host: 'host' } | redisToConnectionString }}" ) ,
22
+ Assert . That ( context . EvaluateScript ( "{{ { host: 'host' } | redisToConnectionString }}" ) ,
22
23
Is . EqualTo ( "host:6379?db=0" ) ) ;
23
24
24
- Assert . That ( context . EvaluateTemplate ( "{{ { port: 7000 } | redisToConnectionString }}" ) ,
25
+ Assert . That ( context . EvaluateScript ( "{{ { port: 7000 } | redisToConnectionString }}" ) ,
25
26
Is . EqualTo ( "localhost:7000?db=0" ) ) ;
26
27
27
- Assert . That ( context . EvaluateTemplate ( "{{ { db: 1 } | redisToConnectionString }}" ) ,
28
+ Assert . That ( context . EvaluateScript ( "{{ { db: 1 } | redisToConnectionString }}" ) ,
28
29
Is . EqualTo ( "localhost:6379?db=1" ) ) ;
29
30
30
- Assert . That ( context . EvaluateTemplate ( "{{ { host: 'host', port: 7000, db: 1 } | redisToConnectionString }}" ) ,
31
+ Assert . That ( context . EvaluateScript ( "{{ { host: 'host', port: 7000, db: 1 } | redisToConnectionString }}" ) ,
31
32
Is . EqualTo ( "host:7000?db=1" ) ) ;
32
33
33
- Assert . That ( context . EvaluateTemplate ( "{{ { host: 'host', port: 7000, db: 1, password:'secret' } | redisToConnectionString | raw }}" ) ,
34
+ Assert . That ( context . EvaluateScript ( "{{ { host: 'host', port: 7000, db: 1, password:'secret' } | redisToConnectionString | raw }}" ) ,
34
35
Is . EqualTo ( "host:7000?db=1&password=secret" ) ) ;
35
36
36
- Assert . That ( context . EvaluateTemplate ( "{{ redisConnectionString }}" ) ,
37
+ Assert . That ( context . EvaluateScript ( "{{ redisConnectionString }}" ) ,
37
38
Is . EqualTo ( "localhost:6379?db=0" ) ) ;
38
39
39
- Assert . That ( context . EvaluateTemplate ( "{{ { db: 1 } | redisChangeConnection }}" ) ,
40
+ Assert . That ( context . EvaluateScript ( "{{ { db: 1 } | redisChangeConnection }}" ) ,
40
41
Is . EqualTo ( "localhost:6379?db=1" ) ) ;
41
42
42
- Assert . That ( context . EvaluateTemplate ( "{{ redisConnectionString }}" ) ,
43
+ Assert . That ( context . EvaluateScript ( "{{ redisConnectionString }}" ) ,
43
44
Is . EqualTo ( "localhost:6379?db=1" ) ) ;
44
45
}
45
46
}
0 commit comments