Beispiel #1
0
        public void StringFromCollections()
        {
            var dic = new DicS <string>();

            Assert.AreEqual("", dic.ToPropertyString());
            dic.Add("Prop1", "a");
            dic.Add("Prop2", "b");
            dic.Add("Prop3", "c");
            Assert.AreEqual("PROP1=a;PROP2=b;PROP3=c;", dic.ToPropertyString());
            var dict = new Dictionary <string, string>();

            Assert.AreEqual("", dict.ToPropertyString());
            dict.Add("Prop1", "a");
            dict.Add("Prop2", "b");
            dict.Add("Prop3", "c");
            Assert.AreEqual("Prop1=a;Prop2=b;Prop3=c;", dict.ToPropertyString());
            var list = new List <string>();

            Assert.AreEqual("", list.ToPropertyString());
            list.Add("Prop1");
            list.Add("Prop2");
            list.Add("Prop3");
            Assert.AreEqual("Prop1;Prop2;Prop3;", list.ToPropertyString());
            var set = new HashSet <string>();

            Assert.AreEqual("", set.ToPropertyString());
            set.Add("Prop1");
            Assert.AreEqual("Prop1;", set.ToPropertyString());
        }