Exemplo n.º 1
0
        public void AsReadOnlyShouldBeAWrapperOfList()
        {
            var readonlyList = _list.AsReadOnly();
            var amount       = 10;

            for (int i = 0; i < amount; ++i)
            {
                _list.Add(i);
            }

            Assert.AreEqual(amount, readonlyList.Count);
            var value = 0;

            foreach (var elem in readonlyList)
            {
                Assert.AreEqual(value, elem);
                value++;
            }
        }
Exemplo n.º 2
0
 public void Init()
 {
     _list         = new GenericList <int>();
     _readonlyList = _list.AsReadOnly();
 }