diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-09-24 05:16:48 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-09-24 05:16:48 +0000 |
commit | ae16fd68ad51eb8bea4442d999d644b6539a647d (patch) | |
tree | 9dde33e42254cd73e905f82ff3570aa93dd5ae10 | |
parent | 910f6a84e5cbaf2873556f7f5ac0294179053b61 (diff) | |
parent | 06ed1dcec3671440f888f4a6f7354de1b176e473 (diff) | |
download | vcard-android13-qpr1-s4-release.tar.gz |
Snap for 9101843 from 06ed1dcec3671440f888f4a6f7354de1b176e473 to tm-qpr1-releaseandroid-13.0.0_r30android-13.0.0_r29android-13.0.0_r28android-13.0.0_r27android-13.0.0_r24android-13.0.0_r23android-13.0.0_r22android-13.0.0_r21android-13.0.0_r20android-13.0.0_r19android-13.0.0_r18android-13.0.0_r17android-13.0.0_r16android13-qpr1-s8-releaseandroid13-qpr1-s7-releaseandroid13-qpr1-s6-releaseandroid13-qpr1-s5-releaseandroid13-qpr1-s4-releaseandroid13-qpr1-s3-releaseandroid13-qpr1-s2-releaseandroid13-qpr1-s1-releaseandroid13-qpr1-release
Change-Id: Ic8157a045ea5caf4c8a1ed213126a866038c7d7e
-rw-r--r-- | tests/Android.bp | 4 | ||||
-rw-r--r-- | tests/src/com/android/vcard/tests/VCardExceptionTest.java | 35 |
2 files changed, 39 insertions, 0 deletions
diff --git a/tests/Android.bp b/tests/Android.bp index 5c49410..ec1d932 100644 --- a/tests/Android.bp +++ b/tests/Android.bp @@ -31,6 +31,10 @@ android_test { static_libs: [ "com.android.vcard", "junit", + "androidx.test.ext.truth", + "androidx.test.rules", + "mockito-target", + "truth-prebuilt", ], jacoco: { diff --git a/tests/src/com/android/vcard/tests/VCardExceptionTest.java b/tests/src/com/android/vcard/tests/VCardExceptionTest.java new file mode 100644 index 0000000..6f09fad --- /dev/null +++ b/tests/src/com/android/vcard/tests/VCardExceptionTest.java @@ -0,0 +1,35 @@ +/* + * Copyright 2022 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.android.vcard.tests; + +import com.android.vcard.exception.VCardException; + +import junit.framework.TestCase; + +public class VCardExceptionTest extends TestCase { + static final String TEST_MESSAGE = "message"; + + public void testExceptionWithoutMessage() { + VCardException exception = new VCardException(); + assertNull(exception.getMessage()); + } + + public void testExceptionWithMessage() { + VCardException exception = new VCardException(TEST_MESSAGE); + assertEquals(exception.getMessage(), TEST_MESSAGE); + } +} |