shill: Create Property Store Inspector

Refactor code instances in unit tests where we need to verify the
existence of a single property in a PropertyStore.  We never need
to do this in "real life", so only include this functionality in
unit tests.

BUG=chromium-os:30046
TEST=Use in unit tests.

Change-Id: I2209e0dbbe8af123a7fe28e0970fa88fe66dcbf2
Reviewed-on: https://gerrit.chromium.org/gerrit/21447
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
diff --git a/service_unittest.cc b/service_unittest.cc
index 424c949..94f6346 100644
--- a/service_unittest.cc
+++ b/service_unittest.cc
@@ -25,6 +25,7 @@
 #include "shill/mock_manager.h"
 #include "shill/mock_profile.h"
 #include "shill/mock_store.h"
+#include "shill/property_store_inspector.h"
 #include "shill/property_store_unittest.h"
 #include "shill/service_under_test.h"
 
@@ -520,11 +521,9 @@
 // our supeclass (PropertyStoreTest) is declared with.
 class ReadOnlyServicePropertyTest : public ServiceTest {};
 TEST_P(ReadOnlyServicePropertyTest, PropertyWriteOnly) {
-  ReadablePropertyConstIterator<string> it =
-      (service_->store()).GetStringPropertiesIter();
   string property(GetParam().reader().get_string());
-  for( ; !it.AtEnd(); it.Advance())
-    EXPECT_NE(it.Key(), property);
+  PropertyStoreInspector inspector(&service_->store());
+  EXPECT_FALSE(inspector.ContainsStringProperty(property));
 }
 
 INSTANTIATE_TEST_CASE_P(