--- /dev/null
+/*
+ * Copyright 2017 Samsung Electronics Co., Ltd
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "EntryNameModalPresenter.hpp"
+
+#include <gtest/gtest.h>
+
+TEST(EntryNameModalPresenter, testConstructor)
+{
+ auto enmp = std::make_unique<EntryNameModalPresenter>("testSwitchID");
+ EXPECT_STRCASEEQ("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH", enmp->getTitle().c_str());
+}
+
+TEST(EntryNameModalPresenter, testAction)
+{
+ auto enmp = std::make_unique<EntryNameModalPresenter>("testSwitchID");
+
+ auto modal_action = enmp->getAction("modalEntry");
+ ASSERT_NE(modal_action, nullptr);
+ EXPECT_EQ(modal_action->actionId_, std::string("modalEntry"));
+ EXPECT_EQ(modal_action->title_.value(), std::string("IDS_ACCS_UNIVERSAL_SWITCH_ADD_SWITCH_NAME"));
+ EXPECT_TRUE(modal_action->enabled_.value());
+ EXPECT_FALSE(modal_action->state_.value());
+
+ auto cancel_action = enmp->getAction("cancelAction");
+
+ ASSERT_NE(cancel_action, nullptr);
+ EXPECT_EQ(cancel_action->actionId_, std::string("cancelAction"));
+ EXPECT_EQ(cancel_action->title_.value(), std::string("IDS_ACCS_UNIVERSAL_SWITCH_CANCEL"));
+ EXPECT_TRUE(cancel_action->enabled_.value());
+ EXPECT_FALSE(cancel_action->state_.value());
+
+ auto save_action = enmp->getAction("doneAction");
+
+ ASSERT_NE(save_action, nullptr);
+ EXPECT_EQ(save_action->actionId_, std::string("doneAction"));
+ EXPECT_EQ(save_action->title_.value(), std::string("IDS_ACCS_UNIVERSAL_SWITCH_SAVE"));
+ EXPECT_FALSE(save_action->enabled_.value());
+ EXPECT_FALSE(save_action->state_.value());
+ if (modal_action->onInvoke_)
+ modal_action->onInvoke_(modal_action);
+ EXPECT_TRUE(save_action->enabled_.value());
+}
+
+int main(int argc, char *argv[])
+{
+ try {
+ ::testing::InitGoogleTest(&argc, argv);
+ return RUN_ALL_TESTS();
+ } catch (...) {
+ return 1;
+ }
+}