1 //******************************************************************
3 // Copyright 2015 Samsung Electronics All Rights Reserved.
5 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
7 // Licensed under the Apache License, Version 2.0 (the "License");
8 // you may not use this file except in compliance with the License.
9 // You may obtain a copy of the License at
11 // http://www.apache.org/licenses/LICENSE-2.0
13 // Unless required by applicable law or agreed to in writing, software
14 // distributed under the License is distributed on an "AS IS" BASIS,
15 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 // See the License for the specific language governing permissions and
17 // limitations under the License.
19 //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
21 #include "UnitTestHelper.h"
23 #include "SceneList.h"
24 #include "OCPlatform.h"
27 using namespace OIC::Service;
30 class SceneCollectionTest: public TestWithMock
35 TestWithMock::SetUp();
36 pSceneList = SceneList::getInstance();
40 SceneList* pSceneList;
41 std::shared_ptr<SceneCollection> pSceneCollection;
44 TEST_F(SceneCollectionTest, createSceneCollectionInstanceAndSceneCollectionResource)
46 bool isNullPtr = false;
47 pSceneCollection = pSceneList->addNewSceneCollection();
49 if(pSceneCollection->getId() == "")
54 EXPECT_FALSE(isNullPtr);
57 TEST_F(SceneCollectionTest, getSceneCollectionInstanceAndSceneCollectionResource)
59 auto sceneCollections = pSceneList->getSceneCollections();
60 bool isNullPtr = false;
62 for(const auto &it : sceneCollections)
68 ASSERT_FALSE(isNullPtr);
72 TEST_F(SceneCollectionTest, setAndGetSceneCollectionResourceName)
74 pSceneCollection = pSceneList->addNewSceneCollection();
75 pSceneCollection->setName("Kitchen");
76 auto sceneCollectionName = pSceneCollection->getName();
78 EXPECT_EQ("Kitchen", sceneCollectionName);