コード例 #1
0
        public void TestLockedSet()
        {
            var ld = new LockingDictionary <int, string>().Locked;

            Assert.ThrowsException <NotSupportedException>(() => ld[0] = "zero");
            Assert.ThrowsException <NotSupportedException>(() => ld.Add(0, "zero"));
            Assert.ThrowsException <NotSupportedException>(() => ld.Clear());
            Assert.ThrowsException <NotSupportedException>(() => ld.Remove(1));
        }