Add SetAppLabel function for group item 77/207377/4
authorhyunho <hhstark.kang@samsung.com>
Tue, 4 Jun 2019 06:01:04 +0000 (15:01 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Mon, 10 Jun 2019 04:37:58 +0000 (04:37 +0000)
Change-Id: I6f2816a5534211a1721bc7c131c86829cd33ebe8
Signed-off-by: hyunho <hhstark.kang@samsung.com>
notification-ex/group_item.cc
notification-ex/group_item.h
unittest/src/test_group_item.cc

index 72896a0..4ead0d9 100644 (file)
@@ -167,5 +167,9 @@ string GroupItem::GetAppLabel() {
   return impl_->app_label_;
 }
 
+void GroupItem::SetAppLabel(string label) {
+  impl_->app_label_ = label;
+}
+
 }  // namespace item
 }  // namespace notification
index a4e7003..fe93cd0 100644 (file)
@@ -116,6 +116,13 @@ class EXPORT_API GroupItem : public AbstractItem {
   std::string GetAppLabel();
 
   /**
+   * @brief Sets app label data of GroupItem.
+   * @since_tizen 5.5
+   * @return The app label data
+   */
+  void SetAppLabel(std::string label);
+
+  /**
    * @brief Adds child notification item.
    * @since_tizen 5.5
    * @param[in] AbstractItem object
index 2196e7c..1e6817c 100644 (file)
@@ -123,6 +123,14 @@ TEST_F(GroupItemTest, GetAppLabel) {
   ASSERT_EQ(app_label, "unittest_appname");
 }
 
+TEST_F(GroupItemTest, SetAppLabel) {
+  GroupItem item("GROUP1");
+  item.SetAppLabel("test");
+  string app_label = item.GetAppLabel();
+
+  ASSERT_EQ(app_label, "test");
+}
+
 TEST_F(GroupItemTest, SetDirection) {
   GroupItem item("GROUP1");
   item.SetDirection(true);