Skip to content

Instantly share code, notes, and snippets.

@imrenagi
Created March 7, 2015 01:29
Show Gist options
  • Save imrenagi/209025aca44c9cbf4cbd to your computer and use it in GitHub Desktop.
Save imrenagi/209025aca44c9cbf4cbd to your computer and use it in GitHub Desktop.
package com.imrenagi.roboelectric_testing;
public class Person {
public Person(){
}
public int add () {
return 1;
}
}
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