1 /*
2  * Copyright (C) 2024 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 
17 package com.android.launcher3.allapps;
18 
19 import static androidx.test.core.app.ApplicationProvider.getApplicationContext;
20 
21 import static com.android.launcher3.LauncherSettings.Favorites.CONTAINER_PRIVATESPACE;
22 
23 import static com.google.common.truth.Truth.assertThat;
24 
25 import android.content.Context;
26 
27 import androidx.test.runner.AndroidJUnit4;
28 
29 import com.android.launcher3.model.data.AppInfo;
30 import com.android.launcher3.util.ActivityContextWrapper;
31 
32 import org.junit.Before;
33 import org.junit.Test;
34 import org.junit.runner.RunWith;
35 import org.mockito.MockitoAnnotations;
36 
37 @RunWith(AndroidJUnit4.class)
38 public class PrivateSpaceSettingsButtonTest {
39 
40     private PrivateSpaceSettingsButton mVut;
41 
42     @Before
setUp()43     public void setUp() {
44         MockitoAnnotations.initMocks(this);
45         Context context = new ActivityContextWrapper(getApplicationContext());
46         mVut = new PrivateSpaceSettingsButton(context);
47     }
48 
49     @Test
privateSpaceSettingsAppInfo_hasCorrectIdAndContainer()50     public void privateSpaceSettingsAppInfo_hasCorrectIdAndContainer() {
51         AppInfo appInfo = mVut.createPrivateSpaceSettingsAppInfo();
52 
53         assertThat(appInfo.id).isEqualTo(CONTAINER_PRIVATESPACE);
54         assertThat(appInfo.container).isEqualTo(CONTAINER_PRIVATESPACE);
55     }
56 }
57