Imported Upstream version 1.2.0
[platform/upstream/iotivity.git] / service / notification / cpp-wrapper / common / NSTopic.cpp
old mode 100644 (file)
new mode 100755 (executable)
similarity index 59%
rename from service/easy-setup/mediator/richsdk/unittests/UnitTestHelper.h
rename to service/notification/cpp-wrapper/common/NSTopic.cpp
index 2bf7424..ce099d9
 //
 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 
-#ifndef COMMON_UTILS_UNITTESTHELPER_H
-#define COMMON_UTILS_UNITTESTHELPER_H
+#include "NSTopic.h"
 
-#include <gtest/gtest.h>
-#include <HippoMocks/hippomocks.h>
-
-class TestWithMock: public testing::Test
+namespace OIC
 {
-    public:
-        MockRepository mocks;
+    namespace Service
+    {
+        std::string NSTopic::getTopicName() const
+        {
+            return m_topicName;
+        }
+
+        void NSTopic::setTopicName(const std::string &topicName)
+        {
+            m_topicName = topicName;
+        }
 
-    protected:
-        virtual ~TestWithMock() noexcept(noexcept(std::declval<Test>().~Test())) {}
+        NSTopic::NSTopicState NSTopic::getState() const
+        {
+            return m_state;
+        }
 
-        virtual void TearDown()
+        void NSTopic::setState(const NSTopic::NSTopicState state)
         {
-            try
-            {
-                mocks.VerifyAll();
-            }
-            catch (...)
-            {
-                mocks.reset();
-                throw;
-            }
+            m_state = state;
         }
-};
-#endif // COMMON_UTILS_UNITTESTHELPER_H
+    }
+}