void StlMapTest::testRemove() { StlMap<string, bool> boolMap; boolMap.put( "fred", true ); CPPUNIT_ASSERT( boolMap.containsKey("fred") == true ); CPPUNIT_ASSERT( boolMap.remove( "fred" ) == true ); CPPUNIT_ASSERT( boolMap.containsKey("fred") == false ); CPPUNIT_ASSERT_THROW_MESSAGE( "Should throw a NoSuchElementException", boolMap.remove( "fred" ), decaf::lang::exceptions::NoSuchElementException ); }
void StlMapTest::testContiansValue() { StlMap<string, bool> boolMap; boolMap.put( "fred", true ); boolMap.put( "fred1", false ); CPPUNIT_ASSERT( boolMap.containsValue(true) == true ); boolMap.remove( "fred" ); CPPUNIT_ASSERT( boolMap.containsValue(true) == false ); }