@@ -16,22 +16,22 @@ namespace Senparc.CO2NET.Cache.CsRedis.Tests
1616 public class InitTests
1717 {
1818 /// <summary>
19- /// 测试 Redis 连接字符串是否可以在 UseSenparcGlobal() 阶段立即生效
19+ /// Test whether the Redis connection string can take effect immediately during the UseSenparcGlobal() phase
2020 /// </summary>
2121 [ TestMethod ]
2222 public void AutoRegisterConfigurationTest ( )
2323 {
24- // 执行常规注册
24+ // Perform regular registration
2525 var serviceCollection = new ServiceCollection ( ) ;
2626 var configBuilder = new ConfigurationBuilder ( ) ;
2727 var config = configBuilder . Build ( ) ;
2828 serviceCollection . AddSenparcGlobalServices ( config ) ;
29- serviceCollection . AddMemoryCache ( ) ; // 使用内存缓存
29+ serviceCollection . AddMemoryCache ( ) ; // Use memory cache
3030
3131 var mockEnv = new Mock < Microsoft . Extensions . Hosting . IHostEnvironment /*IHostingEnvironment*/ > ( ) ;
3232 mockEnv . Setup ( z => z . ContentRootPath ) . Returns ( ( ) => UnitTestHelper . RootPath ) ;
3333
34- RedisManager . ConfigurationOption = null ; // 测试前清除
34+ RedisManager . ConfigurationOption = null ; // Clear before testing
3535
3636 var redisServer = "localhost:6379" ;
3737
@@ -45,11 +45,11 @@ public void AutoRegisterConfigurationTest()
4545 var registerService = Senparc . CO2NET . AspNet . RegisterServices .
4646 RegisterService . Start ( mockEnv . Object , senparcSetting )
4747 . UseSenparcGlobal ( ) ;
48- Assert . AreEqual ( null , RedisManager . ConfigurationOption ) ; // 尚未注册
48+ Assert . AreEqual ( null , RedisManager . ConfigurationOption ) ; // Not registered yet
4949
5050 registerService . RegisterCacheRedis (
5151 redisServer ,
52- redisConfiguration => RedisObjectCacheStrategy . Instance // 第一次调用时将自动注册
52+ redisConfiguration => RedisObjectCacheStrategy . Instance // Will automatically register on the first call
5353 ) ;
5454 Assert . AreEqual ( redisServer , RedisManager . ConfigurationOption ) ;
5555
0 commit comments