package com.brains.junit;
import static org.junit.jupiter.api.Assertions.assertEquals;
import java.util.Arrays;
import java.util.List;
import org.junit.jupiter.api.Test;
class MyMathTest {
private MyMath math = new MyMath();
List todos = Arrays.asList("AWS", "DevOps", "Java");
// test sum {1,2,3} -> 6
@Test
void calculate_sum_three_member() {
assertEquals(6, math.calculateSum(new int[] {1,2,3}));
}
// test sum {} -> 0
@Test
void calculate_sum_zero_lengthArray() {
assertEquals(0, math.calculateSum(new int[] {}));
}
@Test
void test() {
assertEquals(true, todos.contains("AWS"));
assertEquals(3, todos.size());
}
}
Leave a Reply