Skip to content

Instantly share code, notes, and snippets.

View mauricioaniche's full-sized avatar

Maurício Aniche mauricioaniche

View GitHub Profile
@mauricioaniche
mauricioaniche / AplicadorDeDescontos.java
Created November 26, 2012 18:45
Exercicio-desconto
package exercicio.desconto;
public class AplicadorDeDescontos {
public void aplica(Compra compra) {
descontoPorValor(compra);
descontoPorProduto(compra);
}
private void descontoPorProduto(Compra compra) {
@mauricioaniche
mauricioaniche / GeradorDeResumo.java
Created November 26, 2012 18:46
exercicio-listas
package exercicio.lista;
import java.util.ArrayList;
import java.util.List;
public class GeradorDeResumo {
public List<Resumo> gera(List<Negocio> negocios) {
List<Resumo> resumos = new ArrayList<Resumo>();
package exercicio.tdd.sessoes;
import java.util.Calendar;
import java.util.List;
public class GeradorDeSessoes {
public List<Sessao> gera(Calendar inicio, Calendar fim, Periodo periodo, int lugaresPorSessao) {
// aqui... ;)
return null;
protected DefaultSelenium browser;
[SetUp]
public void SetUp()
{
browser = new DefaultSelenium("localhost", 4444, "*firefox", "http://localhost:49278");
browser.Start();
}
[TearDown]
@mauricioaniche
mauricioaniche / Exercises
Created June 2, 2013 20:33
TDD study - Exercises
** Exercise 1 - Salary calculator **
The participant should implement a salary calculator. An employee contains a name,
an email, a base salary, and a position. According to his position, the calculation
rule is different:
- If he is a DEVELOPER, the employee should have a discount of 20% if his salary is
greater than or equals to 3000.00. The discount should be only 10% if salary is smaller
than that.
@mauricioaniche
mauricioaniche / gist:5895261
Created June 30, 2013 14:09
TDD questionnaire
Your name:
How do you evaluate the clarity of the first exercise you implemented? Not clear 1-5 Very clear
How do you evaluate the clarity of the second exercise you implemented? Not clear 1-5 Very clear
How do you evaluate the time you had to solve each of the exercises? Not enough 1-5 More than needed
Did you feel any difficulty to write test code to any of the exercises?
package br.com.caelum.tdd.exercicio1;
import static br.com.caelum.tdd.exercicio1.Cargo.DBA;
import static br.com.caelum.tdd.exercicio1.Cargo.DESENVOLVEDOR;
import static br.com.caelum.tdd.exercicio1.Cargo.TESTER;
public class CalculadoraDeSalario {
public double calcula(Funcionario funcionario) {
@mauricioaniche
mauricioaniche / EnviadorDeEmail.java
Last active December 19, 2015 09:39
Samsung Prova Exercicio 2
package br.com.caelum.tdd.exercicio2;
public interface EnviadorDeEmail {
void enviaEmail(NotaFiscal nf);
}
2 nós
hduser@hadoop-1:/usr/local/hadoop$ time bin/hadoop jar hadoop*examples*.jar wordcount -D mapred.reduce.tasks=16 /user/hduser/aniche /user/hduser/aniche-output3
Warning: $HADOOP_HOME is deprecated.
13/11/07 18:40:22 INFO input.FileInputFormat: Total input paths to process : 1
13/11/07 18:40:22 INFO util.NativeCodeLoader: Loaded the native-hadoop library
13/11/07 18:40:22 WARN snappy.LoadSnappy: Snappy native library not loaded
13/11/07 18:40:23 INFO mapred.JobClient: Running job: job_201311071834_0004
13/11/07 18:40:24 INFO mapred.JobClient: map 0% reduce 0%
5 nos
hduser@hadoop-1:/usr/local/hadoop$ time bin/hadoop jar hadoop*examples*.jar wordcount /user/hduser/aniche /user/hduser/aniche-5maqs-vai
Warning: $HADOOP_HOME is deprecated.
13/11/07 20:47:29 INFO input.FileInputFormat: Total input paths to process : 1
13/11/07 20:47:29 INFO util.NativeCodeLoader: Loaded the native-hadoop library
13/11/07 20:47:29 WARN snappy.LoadSnappy: Snappy native library not loaded