ConnectedDeviceDashboardFragmentTest.java revision f86905ed50f7a5543edb1b7425e0fa2db985de1c
1/*
2 * Copyright (C) 2016 The Android Open Source Project
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 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
15 */
16package com.android.settings.connecteddevice;
17
18import android.content.Context;
19import com.android.settings.SettingsRobolectricTestRunner;
20import com.android.settings.TestConfig;
21import com.android.settings.testutils.FakeFeatureFactory;
22import com.android.settingslib.drawer.CategoryKey;
23import org.junit.Before;
24import org.junit.Test;
25import org.junit.runner.RunWith;
26import org.mockito.Answers;
27import org.mockito.Mock;
28import org.mockito.MockitoAnnotations;
29import org.robolectric.annotation.Config;
30
31import static com.google.common.truth.Truth.assertThat;
32
33@RunWith(SettingsRobolectricTestRunner.class)
34@Config(manifest = TestConfig.MANIFEST_PATH, sdk = TestConfig.SDK_VERSION)
35public class ConnectedDeviceDashboardFragmentTest {
36
37  @Mock(answer = Answers.RETURNS_DEEP_STUBS)
38  private Context mContext;
39
40  private ConnectedDeviceDashboardFragment mFragment;
41
42  @Before
43  public void setUp() {
44    MockitoAnnotations.initMocks(this);
45    FakeFeatureFactory.setupForTest(mContext);
46    mFragment = new ConnectedDeviceDashboardFragment();
47  }
48
49  @Test
50  public void testCategory_isConnectedDevice() {
51    assertThat(mFragment.getCategoryKey()).isEqualTo(CategoryKey.CATEGORY_DEVICE);
52  }
53
54}
55