Skip to content

Instantly share code, notes, and snippets.

View mfebrianto's full-sized avatar

michael febrianto mfebrianto

View GitHub Profile
@mfebrianto
mfebrianto / build.gradle
Created January 29, 2020 23:36
build.gradle of mock
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
defaultConfig {
@mfebrianto
mfebrianto / ExampleInstrumentedtest.kt
Created January 29, 2020 23:39
update of ExampleInstrumentedTest
package com.example.mock
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.assertion.ViewAssertions
import androidx.test.espresso.matcher.ViewMatchers
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.rule.ActivityTestRule
import okhttp3.mockwebserver.MockResponse
import okhttp3.mockwebserver.MockWebServer
@mfebrianto
mfebrianto / witcher_characters.json
Last active February 20, 2020 04:22
characters of witchers
{
"data": {
"characters": [
{
"name": "Geralt of Rivia",
"id": "5d5ae34a799ab50008ba95a0"
},
{
"name": "Vesemir",
"id": "5d5aeb47799ab50008ba95a7"
@mfebrianto
mfebrianto / curl_witcher_chars.sh
Created February 20, 2020 01:38
curl_witcher_chars.sh
curl --request GET 'https://e9a464b0-809c-4c35-be1d-846daa45ed96.mock.pstmn.io/characters'
floatingActionButton: FloatingActionButton(onPressed: _incrementCounter,
tooltip: 'Increment',
child: Icon(Icons.add))
class _MyHomePageState extends State<MyHomePage> {
int _counter = 0;
void _incrementCounter() {
setState(() {
_counter++;
});
}
@override
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
<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"
@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);
}