コード例 #1
0
        public void GetConnectionOptions_KeyLifetimePassed_Parsed()
        {
            var configurationRoot = new ConfigurationBuilder()
                                    .AddJsonFile("TestConfiguration/redis.json", optional: true)
                                    .Build();

            var configuration = new ConnectionConfiguration(configurationRoot);

            var options = configuration.GetConnectionConfigurationOptions();

            Assert.That(options.KeyLifetimes.Count == 2);
        }
コード例 #2
0
        public void GetConnectionOptions_EmptyConnString_ArgumentException()
        {
            var configurationRoot = new ConfigurationBuilder()
                                    .AddJsonFile("TestConfiguration/redisNoConnection.json", optional: true)
                                    .Build();
            var configuration = new ConnectionConfiguration(configurationRoot);

            Assert.That(() =>
            {
                configuration.GetConnectionConfigurationOptions();
            }, Throws.ArgumentException);
        }
コード例 #3
0
        public void GetConnectionOptions_CorrectConnString_Parsed()
        {
            var configurationRoot = new ConfigurationBuilder()
                                    .AddJsonFile("TestConfiguration/redis.json", optional: true)
                                    .Build();

            var configuration = new ConnectionConfiguration(configurationRoot);

            var options = configuration.GetConnectionConfigurationOptions();

            var configurationOptions = options.GetConfigurationOptions();

            Assert.That(configurationOptions.EndPoints.Count == 2);
            Assert.That(configurationOptions.AllowAdmin);
        }