1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
import static org.junit.jupiter.api.Assertions.*;
import org.junit.jupiter.api.Test;
class MaxDotProdTest {
@Test
void test() {
int[] a = new int[] { 60, 100, 120 };
int[] b = new int[] { 20, 50, 30 };
assertEquals(10200, MaxDotProd.getMaxDotProduct(a, b));
}
@Test
void test1() {
int[] a = new int[] { 23};
int[] b = new int[] { 39 };
assertEquals(897, MaxDotProd.getMaxDotProduct(a, b));
}
@Test
void test2() {
int[] a = new int[] { 1,3,-5};
int[] b = new int[] { -2,4,1 };
assertEquals(23, MaxDotProd.getMaxDotProduct(a, b));
}
}
|