11using NUnit . Framework ;
2+ using ServiceStack . Script ;
23using ServiceStack . Templates ;
34
45namespace ServiceStack . Redis . Tests
@@ -8,38 +9,38 @@ class RedisTemplateTests
89 [ Test ]
910 public void Does_build_connection_string ( )
1011 {
11- var context = new TemplateContext
12+ var context = new ScriptContext
1213 {
13- TemplateFilters = { new TemplateRedisFilters ( ) }
14+ ScriptMethods = { new RedisScripts ( ) }
1415 } ;
1516 context . Container . AddSingleton < IRedisClientsManager > ( ( ) => new RedisManagerPool ( ) ) ;
1617 context . Init ( ) ;
1718
18- Assert . That ( context . EvaluateTemplate ( "{{ redisToConnectionString: host:7000?db=1 }}" ) ,
19+ Assert . That ( context . EvaluateScript ( "{{ redisToConnectionString: host:7000?db=1 }}" ) ,
1920 Is . EqualTo ( "host:7000?db=1" ) ) ;
2021
21- Assert . That ( context . EvaluateTemplate ( "{{ { host: 'host' } | redisToConnectionString }}" ) ,
22+ Assert . That ( context . EvaluateScript ( "{{ { host: 'host' } | redisToConnectionString }}" ) ,
2223 Is . EqualTo ( "host:6379?db=0" ) ) ;
2324
24- Assert . That ( context . EvaluateTemplate ( "{{ { port: 7000 } | redisToConnectionString }}" ) ,
25+ Assert . That ( context . EvaluateScript ( "{{ { port: 7000 } | redisToConnectionString }}" ) ,
2526 Is . EqualTo ( "localhost:7000?db=0" ) ) ;
2627
27- Assert . That ( context . EvaluateTemplate ( "{{ { db: 1 } | redisToConnectionString }}" ) ,
28+ Assert . That ( context . EvaluateScript ( "{{ { db: 1 } | redisToConnectionString }}" ) ,
2829 Is . EqualTo ( "localhost:6379?db=1" ) ) ;
2930
30- Assert . That ( context . EvaluateTemplate ( "{{ { host: 'host', port: 7000, db: 1 } | redisToConnectionString }}" ) ,
31+ Assert . That ( context . EvaluateScript ( "{{ { host: 'host', port: 7000, db: 1 } | redisToConnectionString }}" ) ,
3132 Is . EqualTo ( "host:7000?db=1" ) ) ;
3233
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 }}" ) ,
3435 Is . EqualTo ( "host:7000?db=1&password=secret" ) ) ;
3536
36- Assert . That ( context . EvaluateTemplate ( "{{ redisConnectionString }}" ) ,
37+ Assert . That ( context . EvaluateScript ( "{{ redisConnectionString }}" ) ,
3738 Is . EqualTo ( "localhost:6379?db=0" ) ) ;
3839
39- Assert . That ( context . EvaluateTemplate ( "{{ { db: 1 } | redisChangeConnection }}" ) ,
40+ Assert . That ( context . EvaluateScript ( "{{ { db: 1 } | redisChangeConnection }}" ) ,
4041 Is . EqualTo ( "localhost:6379?db=1" ) ) ;
4142
42- Assert . That ( context . EvaluateTemplate ( "{{ redisConnectionString }}" ) ,
43+ Assert . That ( context . EvaluateScript ( "{{ redisConnectionString }}" ) ,
4344 Is . EqualTo ( "localhost:6379?db=1" ) ) ;
4445 }
4546 }
0 commit comments