1 /*
2  * Copyright 2025 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 androidx.appfunctions
18 
19 import android.os.Bundle
20 import com.google.common.truth.Truth.assertThat
21 import org.junit.Test
22 
23 class AppFunctionSystemExceptionsTest {
24     @Test
testErrorCategory_SystemErrornull25     fun testErrorCategory_SystemError() {
26         assertThat(AppFunctionSystemUnknownException(null, Bundle()).internalErrorCode)
27             .isEqualTo(AppFunctionException.ERROR_SYSTEM_ERROR)
28         assertThat(AppFunctionSystemUnknownException(null, Bundle()).errorCategory)
29             .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
30 
31         assertThat(AppFunctionCancelledException(null, Bundle()).internalErrorCode)
32             .isEqualTo(AppFunctionException.ERROR_CANCELLED)
33         assertThat(AppFunctionCancelledException(null, Bundle()).errorCategory)
34             .isEqualTo(AppFunctionException.ERROR_CATEGORY_SYSTEM)
35     }
36 }
37