service_test.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
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  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #include <gtest/gtest.h>
17 #include <gmock/gmock.h>
18 
20 
24 class ServiceTest : public ::testing::Test {
25 public:
26 
27  void SetUp() override {
28  test_service = std::make_shared<Service>();
29  }
30 
31  void TearDown() override {
32  test_service.reset();
33  }
34 protected:
35  std::shared_ptr<Service> test_service;
36 };
37 
38 TEST_F(ServiceTest, Sanity) {
39  ASSERT_TRUE(true);
40 }
41 
45 TEST_F(ServiceTest, TestLifecycle) {
46  EXPECT_EQ(ServiceState::CREATED, test_service->getState());
47  EXPECT_TRUE(test_service->start());
48  EXPECT_EQ(ServiceState::STARTED, test_service->getState());
49  EXPECT_TRUE(test_service->shutdown());
50  EXPECT_EQ(ServiceState::SHUTDOWN, test_service->getState());
51 }
std::shared_ptr< Service > test_service
TEST_F(ServiceTest, Sanity)
void SetUp() override
void TearDown() override


dataflow_lite
Author(s): AWS RoboMaker
autogenerated on Fri May 7 2021 02:18:22