Select Git revision
GridTest.java
Forked from
LABOUREL Arnaud / Game of life Template
Source project has a limited visibility.
-
LABOUREL Arnaud authoredLABOUREL Arnaud authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ComplexTest.java 3.51 KiB
package complex;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.within;
import static org.junit.jupiter.api.Assertions.fail;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
/**
* Test class for the complex class.
*/
class ComplexTest {
private static final float EPSILON = 0.000001F;
@BeforeAll
static void setUpBeforeClass() throws Exception {
// TODO: add message
}
@AfterAll
static void tearDownAfterClass() throws Exception {
// TODO: add message
}
@BeforeEach
void setUp() throws Exception {
// TODO: add message
}
@AfterEach
void tearDown() throws Exception {
// TODO: add message
}
@Test
void testGetterImaginary() {
float expected = 2.0F;
Complex z = new Complex(1.0F, 2.0f);
assertThat(z.getImaginaryPart()).as("problem on getter imaginary")
.isCloseTo(expected, within(EPSILON));
}
@Test
void testGetterReal() {
float expected = 1.0F;
Complex z = new Complex(1.0F, 2.0f);
assertThat(z.getRealPart()).as("problem on getter real")
.isCloseTo(expected, within(EPSILON));
}
@Test
void testSetterImaginary() {
float expected = 3.0F;
Complex z = new Complex();
z.setImaginaryPart(expected);
assertThat(z.getImaginaryPart()).as("problem on setter imaginary")
.isCloseTo(expected, within(EPSILON));