blob: d497b08971f681ee3652be6f2b24ed874362dd8d [file] [log] [blame]
mukesh agrawal9da07772013-05-15 14:15:17 -07001// 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/virtual_device.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#include "shill/technology.h"
15
16namespace shill {
17
mukesh agrawala8f7c492013-06-13 18:31:14 -070018namespace {
19const char kTestDeviceName[] = "tun0";
20const int kTestInterfaceIndex = 5;
21} // namespace {}
22
mukesh agrawal9da07772013-05-15 14:15:17 -070023class VirtualDeviceTest : public testing::Test {
24 public:
25 VirtualDeviceTest()
26 : metrics_(&dispatcher_),
27 manager_(&control_, &dispatcher_, &metrics_, &glib_),
28 device_(new VirtualDevice(&control_,
29 &dispatcher_,
30 &metrics_,
31 &manager_,
32 kTestDeviceName,
33 kTestInterfaceIndex,
34 Technology::kVPN)) {}
35
36 virtual ~VirtualDeviceTest() {}
37
38 protected:
mukesh agrawal9da07772013-05-15 14:15:17 -070039 NiceMockControl control_;
40 EventDispatcher dispatcher_;
41 MockMetrics metrics_;
42 MockGLib glib_;
43 MockManager manager_;
44
45 VirtualDeviceRefPtr device_;
46};
47
mukesh agrawal9da07772013-05-15 14:15:17 -070048TEST_F(VirtualDeviceTest, technology) {
49 EXPECT_EQ(Technology::kVPN, device_->technology());
50 EXPECT_NE(Technology::kEthernet, device_->technology());
51}
52
53} // namespace shill