public void parse_a_two_level_property()
        {
            var path = new DictionaryPath("A.B.a");
            path.Set(theSource, 1);

            theDictionary.Child("A").Child("B")["a"].ShouldEqual(1);
        }
 public bool Equals(DictionaryPath other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Equals(other._parent, _parent));
 }
 /// <summary>
 /// Can be used with dotted paths like:  AppSettings.Child.Nested.Property1
 /// </summary>
 /// <param name="key"></param>
 /// <returns></returns>
 public object this[string key]
 {
     get
     {
         var path = new DictionaryPath(key);
         return path.GetParentSource(this).Get(path.Key);
     } 
     set
     {
         var path = new DictionaryPath(key);
         _children[path].Set(path.Key, value);
     }
 }
 public bool Equals(DictionaryPath other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return Equals(other._parent, _parent);
 }