public static void TestGenerating()
        {
            Parameters tParameters = new Parameters();
            tParameters.Entries.Add("key1", "value1");
            tParameters.Entries.Add("key2", "value2");

            Assert.AreEqual("key1=value1&key2=value2",tParameters.GenerateParametersString());
        }
Exemple #2
0
        public override string ToString()
        {
            Parameters cParameters = new Parameters();
            if (!cTraceEnd)
            {
                cParameters.Entries.Add("Path", StackToString());
                cParameters.Entries.Add("Id", cTraceId.ToString());
            }
            else
            {
                //If trace is over we should not get new parameters, so we indicate an error.
                cParameters.Entries.Add("Path", "Trace_error");
                cParameters.Entries.Add("Id", cTraceId.ToString());
            }

            return cParameters.GenerateParametersString();
        }
        public static void TestParsing()
        {
            Parameters tCompare = new Parameters();
            tCompare.Entries.Add("key1", "value1");
            tCompare.Entries.Add("key2", "value2");

            Parameters tWith= new Parameters("key1=value1&key2=value2");
            tWith.ToString();

            Assert.AreEqual(tWith.Entries["key1"], tCompare.Entries["key1"]);
            Assert.AreEqual(tWith.Entries["key2"], tCompare.Entries["key2"]);
        }