示例#1
0
        public void TestClear()
        {
            // normal Clear()
            AbstractMap <Object, Object> map = new HashMap <Object, Object>();

            map.Put(1, 1);
            map.Clear();
            Assert.IsTrue(map.IsEmpty());

            // Special entrySet return a Set with no Clear method.
            AbstractMap <Object, Object> myMap = new MocAbstractMap <Object, Object>();

            try
            {
                myMap.Clear();
                Assert.Fail("Should throw NotSupportedException");
            }
            catch (NotSupportedException)
            {
            }
        }
示例#2
0
 public override bool IsEmpty()
 {
     return(backingMap.IsEmpty());
 }