Esempio n. 1
0
        public void EmPropertyList_ToAndFromString_DataPreserved()
        {
            var values = new List <int> {
                1, 2, 3, 4, 5
            };

            const string key          = "TestKey";
            var          orig         = new TestSimpleList(key, values);
            var          deserialized = new TestSimpleList(key);

            string originalSerialized = orig.ToString();

            deserialized.FromString(originalSerialized);

            string serialized = deserialized.ToString();


            Assert.AreEqual(values.Count, orig.Values.Count);
            for (int i = 0; i < deserialized.Values.Count; i++)
            {
                Assert.AreEqual(values[i], orig.Values[i]);
            }

            Assert.AreEqual(originalSerialized, serialized);
        }
Esempio n. 2
0
        public void EmPropertyList_FromString_GoodString_GetExpected(string goodString)
        {
            var values = new List <int> {
                1, 2, 3, 4, 5
            };

            var testProp = new TestSimpleList("TestKey");

            testProp.FromString(goodString);

            Assert.AreEqual(values.Count, testProp.Values.Count);
            for (int i = 0; i < testProp.Values.Count; i++)
            {
                Assert.AreEqual(values[i], testProp.Values[i]);
            }
        }