Skip to content

Instantly share code, notes, and snippets.

View mtov's full-sized avatar

Marco Tulio Valente mtov

View GitHub Profile
@mtov
mtov / Book.java
Last active August 19, 2021 19:20
Exemplo de Mocks - usando Mockito
public class Book {
private String titulo;
public Book(String titulo) {
this.titulo = titulo;
}
public String getTitulo() {
return titulo;
}
}
@mtov
mtov / Main.java
Last active October 30, 2021 15:54
Channel Decorator (Design patterns)
interface Channel {
void send(String msg);
String receive();
}
class TCPChannel implements Channel {
public void send(String m) {
System.out.println("Enviando via TCP > " + m);
}
public String receive() {
@mtov
mtov / Stack.java
Last active December 6, 2021 13:53
Teste de unidade de uma classe Stack
import java.util.ArrayList;
import java.util.EmptyStackException;
public class Stack<T> {
private ArrayList<T> elements = new ArrayList<T>();
private int size = 0;
public int size() {
return size;
}
@mtov
mtov / vue.html
Last active January 17, 2024 10:34
Simple Single Page Application (SPA) using Vue.js
<html>
<script src="https://unpkg.com/vue@2"></script>
<body>
<h3>Uma Simples SPA</h3>
<div id="ui">
Temperatura: {{ temperatura }}
<p><button v-on:click="incTemperatura">Incrementa</button></p>
</div>