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) { } }
public override bool IsEmpty() { return(backingMap.IsEmpty()); }