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
class Hello { | |
int test() { | |
String s = null; | |
return s.length(); | |
} | |
} |
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
@RunWith(MockitoJUnitRunner.class) | |
public class MockExampleTest { | |
@Mock | |
Context mockContext; | |
@Test | |
public void readStringFromContext() { | |
when(mockContext.getString(R.string.app_name)).thenReturn("GDG2015"); |
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
Log.info("Start process"); | |
try { | |
if(ennableLogging()) { | |
Log.info("Start doSomething"); | |
} | |
doSomething(); | |
if(ennableLogging()) { | |
Log.info("Finish doSomething"); |
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
--- | |
settings: | |
default-executor: grinder |
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
# Title (concise, 50 characters or fewer, imperative language — "Fetch" vs "Fetches") | |
# Body (detailed explanation) | |
# number (bug/issue/tracking if applicable) |
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
import XCTest | |
@testable import DemoTesting01 | |
class DemoTesting01Tests: XCTestCase { | |
} |
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
/* You are not expected to understand this. */ | |
return TRUE; //return TRUE | |
/** | |
* isValid | |
* return boolean value | |
*/ |
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
public void addFriendToList(List<Friend> friends, Friend newFriend) { | |
if (friends != null && newFriend != null) { | |
friends.add(newFriend); | |
} | |
} |
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
(ns hello-world.handler | |
(:require [compojure.core :refer :all] | |
[compojure.route :as route] | |
[ring.middleware.defaults :refer [wrap-defaults site-defaults]])) | |
(defroutes app-routes | |
(GET "/" [] "Hello World") | |
(route/not-found "Not Found")) | |
(def app |
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
Scenario: Reject Pre-paid account purchase | |
Given a user with "500 THB" in a pre-paid account | |
When the user attemp to buy a "700 THB" ticket | |
Then the purchase is rejected | |
And the user is left with "500 THB" in the account |