Example #1
0
        //--------------------------------------------------------------------------
        //
        //	Methods
        //
        //--------------------------------------------------------------------------

        #region GetParameters

        /// <summary>
        /// format the properties for the querystring 
        /// </summary>
        /// <returns></returns>
        public override Dictionary<string, string> GetParameters()
        {
            var ps = new Dictionary<string, string>();
            
            // apply all of the options to a single hash
            if (GeneralOptions != null)  ps = ps.MergeLeft(GeneralOptions.GetParameters());
            if (LocaleOptions != null) ps = ps.MergeLeft(LocaleOptions.GetParameters());
            if (LocationOptions != null) ps = ps.MergeLeft(LocationOptions.GetParameters());

            return ps;
        }
 public void MergeLeftWithOverwrites()
 {
     var source = new Dictionary<string, string> { { "key", "value" } };
     var candidate = source.MergeLeft(true, new Dictionary<string, string> { { "key", "value2" } }, new Dictionary<string, string> { { "newKey", "newValue" } });
     Assert.IsNotNull(candidate);
     Assert.AreEqual(2, candidate.Count);
     Assert.AreEqual("value2", candidate["key"]);
     Assert.AreEqual("newValue", candidate["newKey"]);
 }