Browse Source

Test for constructor of MemoryZone

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac444@3944 e5f2f494-b856-4b98-b285-d166d9295462
Michal Vaner 14 years ago
parent
commit
98df087fea
1 changed files with 27 additions and 0 deletions
  1. 27 0
      src/lib/datasrc/tests/memory_datasrc_unittest.cc

+ 27 - 0
src/lib/datasrc/tests/memory_datasrc_unittest.cc

@@ -111,4 +111,31 @@ TEST_F(MemoryDataSrcTest, add_find_Zone) {
     EXPECT_EQ(Name("i.g.h"),
               memory_datasrc.findZone(Name("z.i.g.h")).zone->getOrigin());
 }
+
+/// \brief Test fixture for the MemoryZone class
+class MemoryZoneTest : public ::testing::Test {
+public:
+    MemoryZoneTest() :
+        class_(RRClass::IN()),
+        origin_("example.org"),
+        zone_(class_, origin_)
+    { }
+    // Some data to test with
+    RRClass class_;
+    Name origin_;
+    // The zone to torture by tests
+    MemoryZone zone_;
+};
+
+/**
+ * \brief Test MemoryZone::MemoryZone constructor.
+ *
+ * Takes the created zone and checks its properties they are the same
+ * as passed parameters.
+ */
+TEST_F(MemoryZoneTest, Constructor) {
+    ASSERT_EQ(class_, zone_.getClass());
+    ASSERT_EQ(origin_, zone_.getOrigin());
+}
+
 }