Beispiel #1
0
        public void GetLabels_Null()
        {
            ConfigServerClientSettings        settings = new ConfigServerClientSettings();
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string[] result = provider.GetLabels();
            Assert.NotNull(result);
            Assert.Single(result);
            Assert.Equal(string.Empty, result[0]);
        }
        public void GetLabels_Null()
        {
            IHostingEnvironment               envir    = new HostingEnvironment();
            ConfigServerClientSettings        settings = new ConfigServerClientSettings();
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings, envir);

            string[] result = provider.GetLabels();
            Assert.NotNull(result);
            Assert.Equal(1, result.Length);
            Assert.Equal("", result[0]);
        }
#pragma warning disable SA1202 // Elements should be ordered by access
        public void GetLabels_Null()
#pragma warning restore SA1202 // Elements should be ordered by access
        {
            ConfigServerClientSettings        settings = new ConfigServerClientSettings();
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string[] result = provider.GetLabels();
            Assert.NotNull(result);
            Assert.Single(result);
            Assert.Equal(string.Empty, result[0]);
        }
        public void GetLabels_SingleString()
        {
            ConfigServerClientSettings settings = new ConfigServerClientSettings();

            settings.Label = "foobar";
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string[] result = provider.GetLabels();
            Assert.NotNull(result);
            Assert.Single(result);
            Assert.Equal("foobar", result[0]);
        }
        public void GetLabels_Empty()
        {
            var settings = new ConfigServerClientSettings
            {
                Label = string.Empty
            };
            var provider = new ConfigServerConfigurationProvider(settings);

            var result = provider.GetLabels();

            Assert.NotNull(result);
            Assert.Single(result);
            Assert.Equal(string.Empty, result[0]);
        }
        public void GetLabels_MultiStringHoles()
        {
            ConfigServerClientSettings settings = new ConfigServerClientSettings();

            settings.Label = "1,,2,3,";
            ConfigServerConfigurationProvider provider = new ConfigServerConfigurationProvider(settings);

            string[] result = provider.GetLabels();
            Assert.NotNull(result);
            Assert.Equal(3, result.Length);
            Assert.Equal("1", result[0]);
            Assert.Equal("2", result[1]);
            Assert.Equal("3", result[2]);
        }
        public void GetLabels_MultiString()
        {
            var settings = new ConfigServerClientSettings
            {
                Label = "1,2,3,"
            };
            var provider = new ConfigServerConfigurationProvider(settings);

            var result = provider.GetLabels();

            Assert.NotNull(result);
            Assert.Equal(3, result.Length);
            Assert.Equal("1", result[0]);
            Assert.Equal("2", result[1]);
            Assert.Equal("3", result[2]);
        }