Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 1 | // Copyright (c) 2012 The Chromium OS Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "shill/vpn.h" |
| 6 | |
| 7 | #include <gtest/gtest.h> |
| 8 | |
| 9 | #include "shill/event_dispatcher.h" |
| 10 | #include "shill/mock_glib.h" |
| 11 | #include "shill/mock_manager.h" |
| 12 | #include "shill/mock_metrics.h" |
| 13 | #include "shill/nice_mock_control.h" |
| 14 | |
| 15 | namespace shill { |
| 16 | |
| 17 | class VPNTest : public testing::Test { |
| 18 | public: |
| 19 | VPNTest() |
| 20 | : manager_(&control_, &dispatcher_, &metrics_, &glib_), |
| 21 | vpn_(new VPN(&control_, |
| 22 | &dispatcher_, |
| 23 | &metrics_, |
| 24 | &manager_, |
| 25 | kTestDeviceName, |
| 26 | kTestInterfaceIndex)) {} |
| 27 | |
| 28 | virtual ~VPNTest() {} |
| 29 | |
| 30 | protected: |
| 31 | static const char kTestDeviceName[]; |
| 32 | static const int kTestInterfaceIndex; |
| 33 | |
| 34 | NiceMockControl control_; |
| 35 | EventDispatcher dispatcher_; |
| 36 | MockMetrics metrics_; |
| 37 | MockGLib glib_; |
| 38 | MockManager manager_; |
| 39 | |
| 40 | VPNRefPtr vpn_; |
| 41 | }; |
| 42 | |
| 43 | const char VPNTest::kTestDeviceName[] = "tun0"; |
| 44 | const int VPNTest::kTestInterfaceIndex = 5; |
| 45 | |
Joshua Kroll | da79862 | 2012-06-05 12:30:48 -0700 | [diff] [blame] | 46 | TEST_F(VPNTest, technology) { |
| 47 | EXPECT_TRUE(vpn_->technology() == Technology::kVPN); |
| 48 | EXPECT_FALSE(vpn_->technology() == Technology::kEthernet); |
Darin Petkov | f20994f | 2012-03-05 16:12:19 +0100 | [diff] [blame] | 49 | } |
| 50 | |
| 51 | } // namespace shill |