Skip to content

Instantly share code, notes, and snippets.

@LionelBeato
Created July 9, 2021 20:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LionelBeato/738af85dcf3d958664b0d3e4c425009e to your computer and use it in GitHub Desktop.
Save LionelBeato/738af85dcf3d958664b0d3e4c425009e to your computer and use it in GitHub Desktop.
import main.Utility;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
public class SimpleTest {
@Test
public void myTest() {
// fail("This test will fail");
int expected = 5;
int actual = 5;
assertEquals(expected, actual);
}
@Test
public void testClass() {
double expected = 10.234543;
double actual = Utility.add(10, 0.234543);
assertEquals(expected, actual);
}
}
package main;
public class Utility {
public static double add(int x, double y) {
return x + y;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment