Пример #1
0
        public void GetConfigItem_InvalidKey_NullReturnValue()
        {
            //  Arrange
            string consulServer = "http://localhost:8500/";
            ConfigItem configItem = null;
            string configKey = "testing/bogus";

            //  Act
            ConsulManager client = new ConsulManager(consulServer);
            configItem = client.GetConfigItem(configKey);

            //  Assert
            Assert.IsNull(configItem);
        }
Пример #2
0
        public void GetConfigItem_ValidKey_IsSuccessful()
        {
            //  Arrange
            string consulServer = "http://localhost:8500/";
            ConfigItem configItem = null;
            string configKey = "testing/testconfigitem";

            //  Act
            ConsulManager client = new ConsulManager(consulServer);
            configItem = client.GetConfigItem(configKey);

            //  Assert
            Assert.IsNotNull(configItem);
            Debug.WriteLine("The value for key '{0}' is '{1}' (The raw base64 value is: {2})", configItem.Key, configItem.Value, configItem.Base64Value);
        }
Пример #3
0
        public void GetConfigItem_InvalidKey_NullReturnValue()
        {
            //  Arrange
            string     consulServer = "http://localhost:8500/";
            ConfigItem configItem   = null;
            string     configKey    = "testing/bogus";

            //  Act
            ConsulManager client = new ConsulManager(consulServer);

            configItem = client.GetConfigItem(configKey);

            //  Assert
            Assert.IsNull(configItem);
        }
Пример #4
0
        public void GetConfigItem_ValidKey_IsSuccessful()
        {
            //  Arrange
            string     consulServer = "http://localhost:8500/";
            ConfigItem configItem   = null;
            string     configKey    = "testing/testconfigitem";

            //  Act
            ConsulManager client = new ConsulManager(consulServer);

            configItem = client.GetConfigItem(configKey);

            //  Assert
            Assert.IsNotNull(configItem);
            Debug.WriteLine("The value for key '{0}' is '{1}' (The raw base64 value is: {2})", configItem.Key, configItem.Value, configItem.Base64Value);
        }