Improve coverage and add notification unittest
[platform/core/api/notification.git] / notification-ex / null_item.cc
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include <dlog.h>
18
19 #include <memory>
20
21 #include "notification-ex/null_item.h"
22
23 #ifdef LOG_TAG
24 #undef LOG_TAG
25 #endif
26
27 #define LOG_TAG "NOTIFICATION_EX"
28
29 using namespace std;
30 using namespace tizen_base;
31
32 namespace notification {
33 namespace item {
34
35 /* LCOV_EXCL_START */
36 NullItem::NullItem(shared_ptr<AbstractAction> action)
37     : AbstractItem(action) {
38 }
39
40 NullItem::NullItem(string id,
41       shared_ptr<AbstractAction> action)
42     : AbstractItem(id, action) {
43 }
44 NullItem::~NullItem() = default;
45
46 int NullItem::GetType() const {
47   return AbstractItem::NullObject;
48 }
49
50 Bundle NullItem::Serialize() const {
51   Bundle b;
52   b = AbstractItem::Serialize();
53   return b;
54 }
55
56 void NullItem::Deserialize(Bundle b) {
57   AbstractItem::Deserialize(b);
58 }
59
60 AbstractItem& NullItem::FindByID(std::string id) {
61   return *this;
62 }
63
64 bool NullItem::IsItemTypeExist(int type) {
65   if (GetType() == type)
66     return true;
67   return false;
68 }
69 /* LCOV_EXCL_STOP */
70
71 }  // namespace item
72 }  // namespace notification