public void TestParse(string propertyLine, string expectedKey, string expectedValue)
        {
            var source = new PropertiesPropertySource(propertyLine);

            var properties = source.Load();

            Assert.AreEqual(properties.Get(expectedKey), expectedValue);
        }
Ejemplo n.º 2
0
        public PropertyStore Load()
        {
            if (File.Exists(_filepath))
            {
                Log.Info(string.Format("Loading properties from {0}", _filepath));

                var rawProperties = File.ReadAllText(_filepath);
                var src           = new PropertiesPropertySource(rawProperties);
                return(src.Load());
            }
            else
            {
                Log.Warn(string.Format("Properties file not found ({0})!", _filepath));
            }

            return(new PropertyStore());
        }
        public PropertyStore Load()
        {
            if (File.Exists(_filepath))
            {
                Log.Info(string.Format("Loading properties from {0}", _filepath));

                var rawProperties = File.ReadAllText(_filepath);
                var src = new PropertiesPropertySource(rawProperties);
                return src.Load();
            }
            else
            {
                Log.Warn(string.Format("Properties file not found ({0})!", _filepath));
            }

            return new PropertyStore();
        }