blob: f4a7dac75d36553d46787474167206c0c336f046 [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()
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
43const char VPNTest::kTestDeviceName[] = "tun0";
44const int VPNTest::kTestInterfaceIndex = 5;
45
46TEST_F(VPNTest, TechnologyIs) {
47 EXPECT_TRUE(vpn_->TechnologyIs(Technology::kVPN));
48 EXPECT_FALSE(vpn_->TechnologyIs(Technology::kEthernet));
49}
50
51} // namespace shill