Created
March 7, 2015 01:29
-
-
Save imrenagi/209025aca44c9cbf4cbd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.imrenagi.roboelectric_testing; | |
public class Person { | |
public Person(){ | |
} | |
public int add () { | |
return 1; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.imrenagi.roboelectric_testing; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.robolectric.RobolectricTestRunner; | |
import org.robolectric.annotation.Config; | |
@Config(emulateSdk = 18) | |
@RunWith(RobolectricTestRunner.class) | |
public class PersonTest { | |
Person mPerson; | |
@Before | |
public void setUp() { | |
mPerson = new Person(); | |
} | |
@Test | |
public void shouldReturnOne() { | |
Assert.assertEquals(1, mPerson.add()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment