#include "notification-ex/checkbox_item.h"
#include "notification-ex/item_inflator.h"
+using namespace notification;
using namespace notification::item;
class CheckBoxItemTest : public ::testing::Test {
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());
}