Exemplo n.º 1
0
        public void RedisContainer_CtorTest()
        {
            const string endpoint  = "localhost:6379";
            var          conn      = new RedisConnection(endpoint);
            var          container = new RedisContainer(conn);

            Assert.That(container.Connection, Is.EqualTo(conn));
        }
Exemplo n.º 2
0
        private static RedisHash <string, string[]> SetupRedis(IConfiguration configuration, string dirPath, string function)
        {
            var optionsRedis = configuration
                               .GetSection(AppSettingsSections.RedisSection)
                               .Get <RedisOptions>();

            var connection = new RedisConnection($"{optionsRedis.Host}:{optionsRedis.Port}, {GlobalConstants.AbortConnect}", dirPath);
            var container  = new RedisContainer(connection, optionsRedis.InstanceName);

            var data = container.GetKey <RedisHash <string, string[]> >(GlobalConstants.RedisCacheRecords + function);

            return(data);
        }
Exemplo n.º 3
0
 public ContainerTests(RedisFixture fixture)
 {
     this.container = new RedisContainer(fixture.RedisConnection, GlobalConstants.TestContainer);
 }
Exemplo n.º 4
0
 public HashDictionaryTests(RedisFixture fixture)
 {
     this.container      = new RedisContainer(fixture.RedisConnection, GlobalConstants.TestHashContainer);
     this.hashDictionary = new RedisHash <string, int>("hashdictkey");
     this.container.AddToContainer(this.hashDictionary);
 }
Exemplo n.º 5
0
 public HashTests(RedisFixture fixture)
 {
     this.container = new RedisContainer(fixture.RedisConnection, GlobalConstants.TestHashContainer);
     this.hashItem  = new RedisValueHash("hashkey");
     this.container.AddToContainer(this.hashItem);
 }
Exemplo n.º 6
0
 public void Init()
 {
     _container = new RedisContainer(_redisConnection, "misc");
 }