blob: 4d71e63a7190519592a714634e22fdb036fd9f63 [file] [log] [blame]
Darin Petkovf20994f2012-03-05 16:12:19 +01001// 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
15namespace shill {
16
17class VPNTest : public testing::Test {
18 public:
19 VPNTest()
Thieu Le6c1e3bb2013-02-06 15:20:35 -080020 : metrics_(&dispatcher_),
21 manager_(&control_, &dispatcher_, &metrics_, &glib_),
Darin Petkovf20994f2012-03-05 16:12:19 +010022 vpn_(new VPN(&control_,
23 &dispatcher_,
24 &metrics_,
25 &manager_,
26 kTestDeviceName,
27 kTestInterfaceIndex)) {}
28
29 virtual ~VPNTest() {}
30
31 protected:
32 static const char kTestDeviceName[];
33 static const int kTestInterfaceIndex;
34
35 NiceMockControl control_;
36 EventDispatcher dispatcher_;
37 MockMetrics metrics_;
38 MockGLib glib_;
39 MockManager manager_;
40
41 VPNRefPtr vpn_;
42};
43
44const char VPNTest::kTestDeviceName[] = "tun0";
45const int VPNTest::kTestInterfaceIndex = 5;
46
Joshua Krollda798622012-06-05 12:30:48 -070047TEST_F(VPNTest, technology) {
48 EXPECT_TRUE(vpn_->technology() == Technology::kVPN);
49 EXPECT_FALSE(vpn_->technology() == Technology::kEthernet);
Darin Petkovf20994f2012-03-05 16:12:19 +010050}
51
52} // namespace shill