public void TestPropertiesToStringId1()
        {
            NameValueCollection props = new NameValueCollection {
                { "aa", "bb" }, { "bb", "aa" }
            };
            NameValueCollection props2 = PropertiesConverter.StringToProperties(PropertiesConverter.PropertiesToString(props));

            Assert.AreEqual(2, props2.Count);
            Assert.AreEqual("bb", props2.Get("aa"));
            Assert.AreEqual("aa", props2.Get("bb"));
        }
        public void TestPropertiesToString()
        {
            string s1 = "prop1=val1,prop2=val2";
            string s2 = "prop2=val2,prop1=val1";
            NameValueCollection props = new NameValueCollection {
                { "prop1", "val1" }, { "prop2", "val2" }
            };
            string result = PropertiesConverter.PropertiesToString(props);

            Assert.IsTrue(result.Equals(s1) || result.Equals(s2));
        }
        public void TestPropertiesToStringId2()
        {
            // Warning: = in the key is not handled properly, = in the value is OK
            NameValueCollection props = new NameValueCollection {
                { "a=a", "bb" }, { "bb", "a=a" }
            };
            NameValueCollection props2 = PropertiesConverter.StringToProperties(PropertiesConverter.PropertiesToString(props));

            Assert.AreEqual(2, props2.Count);
            Assert.AreEqual("a=bb", props2.Get("a"));
            Assert.AreEqual("a=a", props2.Get("bb"));
        }
        public void TestPropertiesToStringEmpty()
        {
            NameValueCollection props = new NameValueCollection();

            Assert.AreEqual("", PropertiesConverter.PropertiesToString(props));
        }
        /// <summary>
        /// @see IJobOperator#GetParameters .
        /// </summary>
        /// <param name="executionId"></param>
        /// <returns></returns>
        /// <exception cref="NoSuchJobExecutionException">&nbsp;</exception>
        public string GetParameters(long executionId)
        {
            JobExecution jobExecution = FindExecutionById(executionId);

            return(PropertiesConverter.PropertiesToString(_jobParametersConverter.GetProperties(jobExecution.JobParameters)));
        }