Skip to content

Instantly share code, notes, and snippets.

View capablaza's full-sized avatar

Carlos Apablaza capablaza

View GitHub Profile
import org.junit.Assert;
import org.junit.Test;
public class TransferTest {
@Test
public void test() {
// ARRANGE
TransferApiService apiClient = new TransferApiServiceStub(false, "error transfer");
public class TransferService{
private TransferApiService apiService;
private ErrorStorage errorStorage;
private boolean ACCEPTED = true;
private boolean REJECTED = true;
public TransferService(apiClient, storage){
apiService = apiClient;
errorStorage = storage;
}
//function target
public conversorMoney(String from, String to, value);
@Test
public conversorMoneyTest(){
String originCurrency = "USD";
String destinationCurrency = "CLP";
int value = 1000;
@capablaza
capablaza / StringChallenge.java
Created January 18, 2016 03:01
String Challenge
package cl.solojava.string.challenge.run;
import java.text.SimpleDateFormat;
import java.util.Date;
public class AppRun {
public static final String DATE_FORMAT = "hh:mm:ss";
public static String DATA_PROOF = "adfghjklqrtyueiowmasbdabsod";
@capablaza
capablaza / GenericDAO.java
Created September 15, 2014 02:43
Spring mongodb GenericDAO
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.GenericXmlApplicationContext;
import org.springframework.data.mongodb.core.MongoOperations;
import java.util.List;
public class GenericDAO<T> {
final Class<T> clazz;
@capablaza
capablaza / readJson.js
Created August 28, 2014 21:55
Read json file using nodejs
var fileJSON = require('./test.json');
console.log(JSON.parse(fileJSON));
@capablaza
capablaza / Conditional.cs
Created August 18, 2014 18:40
Conditional examples use
public class Conditionals
{
public static void _if()
{
int i = 5;
if (i == 5)
{
@capablaza
capablaza / Loop.cs
Created August 18, 2014 15:50
Loop in C#
/// <summary>
/// Allows that see the different iterators sentences
/// </summary>
public class Loops
{
public static void _while()
{
@capablaza
capablaza / FileRead.cs
Created August 18, 2014 15:30
Read file with c# .
/// <summary>
/// This class allows read a file than simple way.
/// </summary>
public class FileRead
{
/// <summary>
/// Routine that return a StringBuilder with the content that was read
/// </summary>
/// <param name="pathFile">Filename to read.(Include full path)</param>
@capablaza
capablaza / ControlSentence.java
Created August 13, 2014 21:27
ControlSentence example
public class ControlSentence {
static void _if() {
int i = 5;
if (i == 5) {
System.out.format("The value is %d \n", i);