Improve unit TCs
[platform/core/api/notification.git] / unittest / src / test_checkbox_item.cc
index 6fd38dd..bdcb246 100644 (file)
@@ -20,6 +20,7 @@
 #include "notification-ex/checkbox_item.h"
 #include "notification-ex/item_inflator.h"
 
+using namespace notification;
 using namespace notification::item;
 
 class CheckBoxItemTest : public ::testing::Test {
@@ -55,10 +56,9 @@ TEST_F(CheckBoxItemTest, FindByIDNullItemReturn) {
 TEST_F(CheckBoxItemTest, SerializeDeserialize) {
   Bundle b = CheckBoxItemTest::item->Serialize();
 
-  ItemFactory factory;
-  std::shared_ptr<AbstractItem> gen_item = ItemInflator::Create(factory, b);
-  ASSERT_EQ(CheckBoxItemTest::item->GetType(), gen_item.get()->GetType());
+  std::shared_ptr<AbstractItem> gen_item = ItemInflator::Create(b);
+  ASSERT_EQ(CheckBoxItemTest::item->GetType(), gen_item->GetType());
 
-  CheckBoxItem* gen_checkbox = static_cast<CheckBoxItem*>(gen_item.get());
+  auto gen_checkbox = std::static_pointer_cast<CheckBoxItem>(gen_item);
   ASSERT_EQ(CheckBoxItemTest::item->GetTitle(), gen_checkbox->GetTitle());
 }