ExampleInstrumentedTest.java 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Nextcloud Talk application
  3. *
  4. * @author Mario Danic
  5. * Copyright (C) 2017-2019 Mario Danic <mario@lovelyhq.com>
  6. *
  7. * This program is free software: you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation, either version 3 of the License, or
  10. * at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. package com.nextcloud.talk;
  21. import android.content.Context;
  22. import androidx.test.InstrumentationRegistry;
  23. import androidx.test.runner.AndroidJUnit4;
  24. import org.junit.Test;
  25. import org.junit.runner.RunWith;
  26. import static org.junit.Assert.assertEquals;
  27. /**
  28. * Instrumented test, which will execute on an Android device.
  29. *
  30. * @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
  31. */
  32. @RunWith(AndroidJUnit4.class)
  33. public class ExampleInstrumentedTest {
  34. @Test
  35. public void useAppContext() throws Exception {
  36. // Context of the app under test.
  37. Context appContext = InstrumentationRegistry.getTargetContext();
  38. assertEquals("com.nextcloud.talk", appContext.getPackageName());
  39. }
  40. }