public FreeRedisConfigurations()
 {
     _clients = new Dictionary <string, FreeRedisConfiguration>()
     {
         [RedisClientNameAttribute.GetClientName <DefaultClient>()] = new FreeRedisConfiguration()
     };
 }
        public void Should_Get_Specified_Name()
        {
            var name = RedisClientNameAttribute
                       .GetClientName <TestClient2>();

            Assert.Equal("Test2", name);
        }
 public FreeRedisConfigurations Configure <TContainer>(
     Action <FreeRedisConfiguration> configureAction)
 {
     return(Configure(
                RedisClientNameAttribute.GetClientName <TContainer>(),
                configureAction
                ));
 }
        public void GetName_By_Type()
        {
            var expected = typeof(TestClient1).FullName;
            var name     = RedisClientNameAttribute
                           .GetClientName(typeof(TestClient1));

            Assert.Equal(expected, name);
        }
        public void Should_Get_Full_Class_Name_If_Not_Specified()
        {
            var expected = typeof(TestClient1).FullName;

            var name = RedisClientNameAttribute
                       .GetClientName <TestClient1>();

            Assert.Equal(expected, name);
        }
Beispiel #6
0
 public static RedisClient Get <TClient>(this IRedisClientFactory clientFactory)
 {
     return(clientFactory.Get(
                RedisClientNameAttribute.GetClientName <TClient>()
                ));
 }
 public FreeRedisConfiguration GetConfiguration <TContainer>()
 {
     return(GetConfiguration(RedisClientNameAttribute.GetClientName <TContainer>()));
 }