Skip to content

Commit cedfe11

Browse files
committed
Fix
1 parent 1229321 commit cedfe11

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/test/java/com/thealgorithms/conversions/AffineConverterTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ void testConstructorWithValidValues() {
2323

2424
@Test
2525
void testConstructorWithInvalidValues() {
26-
assertThrows(IllegalArgumentException.class,
27-
() -> new AffineConverter(Double.NaN, 3.0),
28-
"Constructor should throw IllegalArgumentException for NaN slope");
26+
assertThrows(IllegalArgumentException.class, () -> new AffineConverter(Double.NaN, 3.0), "Constructor should throw IllegalArgumentException for NaN slope");
2927
}
3028

3129
@Test
3230
void testConvertWithNegativeValues() {
3331
assertEquals(-1.0, converter.convert(-2.0), "Negative input should convert correctly");
34-
assertEquals(-3.0, new AffineConverter(-1.0, -1.0).convert(2.0),
35-
"Slope and intercept can be negative");
32+
assertEquals(-3.0, new AffineConverter(-1.0, -1.0).convert(2.0), "Slope and intercept can be negative");
3633
}
3734

3835
@Test
@@ -51,8 +48,7 @@ void testInvert() {
5148
@Test
5249
void testInvertWithZeroSlope() {
5350
AffineConverter zeroSlopeConverter = new AffineConverter(0.0, 3.0);
54-
assertThrows(AssertionError.class, zeroSlopeConverter::invert,
55-
"Invert should throw AssertionError when slope is zero");
51+
assertThrows(AssertionError.class, zeroSlopeConverter::invert, "Invert should throw AssertionError when slope is zero");
5652
}
5753

5854
@Test
@@ -68,7 +64,7 @@ void testCompose() {
6864
void testMultipleCompositions() {
6965
AffineConverter c1 = new AffineConverter(2.0, 1.0);
7066
AffineConverter c2 = new AffineConverter(3.0, -2.0);
71-
AffineConverter c3 = c1.compose(c2); // (2x + 1) ∘ (3x - 2) => 6x - 1
67+
AffineConverter c3 = c1.compose(c2); // (2x + 1) ∘ (3x - 2) => 6x - 1
7268

7369
assertEquals(-3.0, c3.convert(0.0), "Composed transformation should return -3.0 at 0.0");
7470
assertEquals(3.0, c3.convert(1.0), "Composed transformation should return 3.0 at 1.0");
@@ -86,7 +82,6 @@ void testIdentityComposition() {
8682
@Test
8783
void testLargeInputs() {
8884
double largeValue = 1e6;
89-
assertEquals(2.0 * largeValue + 3.0, converter.convert(largeValue),
90-
"Should handle large input values without overflow");
85+
assertEquals(2.0 * largeValue + 3.0, converter.convert(largeValue), "Should handle large input values without overflow");
9186
}
9287
}

0 commit comments

Comments
 (0)