Skip to content

Instantly share code, notes, and snippets.

@kevinwestern
Created January 22, 2015 04:42
Show Gist options
  • Save kevinwestern/35350da516f98da55073 to your computer and use it in GitHub Desktop.
Save kevinwestern/35350da516f98da55073 to your computer and use it in GitHub Desktop.
// Calculator.java
public class Calculator {
public Calculator() {
}
public int add(int num1, int num2) {
return num1 + num2;
}
}
// CalculatorTest.java
public class CalculatorTest {
public void testAdd() {
Calculator calc = new Calculator();
int result = calc.add(1, 2);
int expectedValue = 3;
assertEqual(result, expectedValue);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment