File Edit View Navigate Codę Analyze Refactor Build Run
Bp Project ▼ O I #’r
▼ F? my-test-app /usr/local/code/my-test-app
► Cl .gradle
► Q .idea
► Cl build Cl libs ▼ Cl src
► DandroidTest
► Q main ▼ Cl test
▼ Qjava
▼ El com.ecgreb.mytestapp ^3 ExampleUnitTest
◄0 .gitignore
P app.iml
O build.gradle
li) proguard-rules.pro
► Cl build
► Cl gradle O .gitignore (iz build.gradle
[Jj| gradle.properties H gradlew [D gradlew.bat [III local.properties P my-test-app.iml
t*. co++innc nrarllo
Run [53 ExampleUnitTest
Rerun Failed Tests[ ‘ A Li ~j *
i ▼ hxampieUnitTest (com.ecgreb.mytestapp)
O mainActivity_shouldNotBeNull O additionJsCorrect thisTestShouldFail
lools VCS Window Help @ ExampleUnitTest.java x
1 package com.ecgreb.mytestapp;
2
3 import org.junit.Test;
4
5 import static org.junit.Assert.*;
8 * Example local unit test, which will execute on the development machinę (host)
10 * Osee <a href="http://d. android.com/tools/testing">Testing documentation</a>
11 */
12 !i public class ExampleUnitTest {
13 C> @Test public void addition_isCorrect() throws Exception {
14 assertEquals(4, 2+2);
16
17 C> @Test public void mainActivity_shouldNotBeNull() throws Exception {
18 MainActivity mainActivity = new MainActivity();
19 assertNotNull(mainActivity);
20 }
21
22 V @Test public void thisTestShouldFail() throws Exception {
23 assertNotNull(nuli);
3 tests done: 1 failed - 199ms
199ms /usr/lib/jvm/java-8-oracle/bin/java ...
171ms
Oms ±1 java.lang.AssertionError <4 internal calls>
28ms®^a’t com.ecgreb.mytestapp. ExampleUnitTest. thisTestShouldFail(ExampleUnitTest. java:23) <27 internal calls>
Process finished with exit codę 255