1 /*
2  * Copyright (C) 2017 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  */
16 package com.android.settings.bluetooth;
17 
18 import static com.android.settings.bluetooth.BluetoothDetailsMacAddressController.KEY_DEVICE_DETAILS_FOOTER;
19 
20 import static com.google.common.truth.Truth.assertThat;
21 
22 import com.android.settingslib.widget.FooterPreference;
23 
24 import org.junit.Ignore;
25 import org.junit.Test;
26 import org.junit.runner.RunWith;
27 import org.robolectric.RobolectricTestRunner;
28 
29 @RunWith(RobolectricTestRunner.class)
30 @Ignore
31 public class BluetoothDetailsMacAddressControllerTest extends BluetoothDetailsControllerTestBase {
32     private BluetoothDetailsMacAddressController mController;
33 
34     @Override
setUp()35     public void setUp() {
36         super.setUp();
37         mController =
38                 new BluetoothDetailsMacAddressController(mContext, mFragment, mCachedDevice,
39                         mLifecycle);
40         setupDevice(mDeviceConfig);
41         mScreen.addPreference(new FooterPreference.Builder(mContext).setKey(
42                 KEY_DEVICE_DETAILS_FOOTER).setTitle(KEY_DEVICE_DETAILS_FOOTER).build());
43     }
44 
45     @Test
macAddress()46     public void macAddress() {
47         showScreen(mController);
48         FooterPreference footer =
49                 (FooterPreference) mScreen.findPreference(mController.getPreferenceKey());
50         assertThat(footer.getTitle().toString()).endsWith(mDeviceConfig.getAddress());
51     }
52 }
53