forked from bitcoin-education/bitcoin-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFieldElementTest.java
More file actions
24 lines (19 loc) · 858 Bytes
/
FieldElementTest.java
File metadata and controls
24 lines (19 loc) · 858 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import io.github.bitcoineducation.bitcoinjava.FieldElement;
import java.util.stream.Stream;
import static java.math.BigInteger.valueOf;
import static org.junit.jupiter.api.Assertions.assertEquals;
public class FieldElementTest {
@ParameterizedTest()
@MethodSource("testAddParameters")
public void testAdd(FieldElement a, FieldElement b, FieldElement expectedResult) {
assertEquals(expectedResult, a.add(b));
}
private static Stream<Arguments> testAddParameters() {
return Stream.of(
Arguments.of(new FieldElement(valueOf(44), valueOf(57)), new FieldElement(valueOf(33), valueOf(57)), new FieldElement(valueOf(20), valueOf(57)))
);
}
}