Skip to content

Instantly share code, notes, and snippets.

View mfebrianto's full-sized avatar

michael febrianto mfebrianto

View GitHub Profile
class IronManMk1 {
fun getRepulsorsStatus() {
println("jarvis: repulsors no power")
}
val repulsorsStatus = println("jarvis: repulsors no power")
}
private val mContext = mockk<Context>
@RunWith(RobolectricTestRunner.class)
public class MyActivityTest {
}
@Mock
Activity mock
object ExampleSpec : Spek({
describe("simple test") {
it("returns true") {
assertTrue(true)
}
}
})
@mfebrianto
mfebrianto / junitExample1Test.java
Last active September 1, 2022 12:15
simplest form of junit
@Test
public void itWillReturnTrue() {
String expected = "Ramesh";
String actual = "Ramesh";
assertEquals(expected, actual);
}
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/widget_item_wrapper"
android:layout_width="match_parent"
android:layout_height="40dp"
android:background="@drawable/background_widget_white">
<TextView
android:id="@+id/remaining_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
incrementCounter(newNumber) {
setState(() {
_counter = newNumber;
});
}
@override
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
incrementCounter(newNumber) {
setState(() {
_counter = newNumber;
});
}
@override
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override