Ejemplo n.º 1
0
        public bool IsSame(IntListClass other)
        {
            if (List1 == null)
            {
                return(other.List1 == null);
            }
            if (List1.Count != other.List1.Count)
            {
                return(false);
            }

            return((List1.Count == 0) ||
                   ((List1[0] == other.List1[0]) &&
                    (List1[1] == other.List1[1]) &&
                    (List1[2] == other.List1[2])));
        }
Ejemplo n.º 2
0
        public void FilledList()
        {
            var value = new IntListClass(true);
            var w     = new Writer();
            var cs    = new ClassSerializer(typeof(IntListClass));

            Assert.True(cs.Write(w, value, null));
            Assert.AreEqual("!Test.IntListClass{List1:[11,42,65]}", w.ToString());

            var r      = new Reader(w.ToString());
            var result = cs.Read(r, null, null) as IntListClass;

            Assert.IsNotNull(result);
            Assert.IsFalse(r.AnyLeft, "Any characters left.");
            Assert.IsTrue(value.IsSame(result), "Read back value is not the same.");
        }