Beispiel #1
0
        public void TestModifyMaster()
        {
            List <string>         strings = new List <string>(new string[] { "a", "b", "c" });
            ReadOnlyList <String> read    = new ReadOnlyList <string>(strings, false);

            Assert.AreEqual(3, read.Count);
            strings.RemoveAt(2);
            Assert.AreEqual(2, read.Count);
            Assert.AreEqual("a", read[0]);
            Assert.AreEqual("b", read[1]);

            Assert.AreEqual("a,b", String.Join(",", read.Clone().ToArray()));
        }
        public void TestModifyMaster()
        {
            List<string> strings = new List<string>(new string[] { "a", "b", "c" });
            ReadOnlyList<String> read = new ReadOnlyList<string>(strings, false);

            Assert.AreEqual(3, read.Count);
            strings.RemoveAt(2);
            Assert.AreEqual(2, read.Count);
            Assert.AreEqual("a", read[0]);
            Assert.AreEqual("b", read[1]);

            Assert.AreEqual("a,b", String.Join(",", read.Clone().ToArray()));
        }