Skip to content

Commit 167d13c

Browse files
committed
Fix
1 parent e48e13c commit 167d13c

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

src/test/java/com/thealgorithms/dynamicprogramming/WineProblemTest.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class WineProblemTest {
1818
void testWpRecursion() {
1919
int[] wines = {2, 3, 5, 1, 4}; // Prices of wines
2020
int expectedProfit = 50; // The expected maximum profit
21-
assertEquals(expectedProfit, WineProblem.wpRecursion(wines, 0, wines.length - 1),
22-
"The maximum profit using recursion should be 50.");
21+
assertEquals(expectedProfit, WineProblem.wpRecursion(wines, 0, wines.length - 1), "The maximum profit using recursion should be 50.");
2322
}
2423

2524
/**
@@ -29,8 +28,7 @@ void testWpRecursion() {
2928
void testWptd() {
3029
int[] wines = {2, 3, 5, 1, 4}; // Prices of wines
3130
int expectedProfit = 50; // The expected maximum profit
32-
assertEquals(expectedProfit, WineProblem.wptd(wines, 0, wines.length - 1, new int[wines.length][wines.length]),
33-
"The maximum profit using top-down DP should be 50.");
31+
assertEquals(expectedProfit, WineProblem.wptd(wines, 0, wines.length - 1, new int[wines.length][wines.length]), "The maximum profit using top-down DP should be 50.");
3432
}
3533

3634
/**
@@ -40,8 +38,7 @@ void testWptd() {
4038
void testWpbu() {
4139
int[] wines = {2, 3, 5, 1, 4}; // Prices of wines
4240
int expectedProfit = 50; // The expected maximum profit
43-
assertEquals(expectedProfit, WineProblem.wpbu(wines),
44-
"The maximum profit using bottom-up DP should be 50.");
41+
assertEquals(expectedProfit, WineProblem.wpbu(wines), "The maximum profit using bottom-up DP should be 50.");
4542
}
4643

4744
/**
@@ -51,8 +48,7 @@ void testWpbu() {
5148
void testSingleWine() {
5249
int[] wines = {10}; // Only one wine
5350
int expectedProfit = 10; // Selling the only wine at year 1
54-
assertEquals(expectedProfit, WineProblem.wpbu(wines),
55-
"The maximum profit for a single wine should be 10.");
51+
assertEquals(expectedProfit, WineProblem.wpbu(wines), "The maximum profit for a single wine should be 10.");
5652
}
5753

5854
/**
@@ -62,8 +58,7 @@ void testSingleWine() {
6258
void testSamePriceWines() {
6359
int[] wines = {5, 5, 5}; // All wines have the same price
6460
int expectedProfit = 30; // Profit is 5 * (1 + 2 + 3)
65-
assertEquals(expectedProfit, WineProblem.wpbu(wines),
66-
"The maximum profit with same price wines should be 30.");
61+
assertEquals(expectedProfit, WineProblem.wpbu(wines), "The maximum profit with same price wines should be 30.");
6762
}
6863

6964
/**
@@ -72,7 +67,6 @@ void testSamePriceWines() {
7267
@Test
7368
void testNoWines() {
7469
int[] wines = {};
75-
assertThrows(IllegalArgumentException.class, () -> WineProblem.wpbu(wines),
76-
"The maximum profit for no wines should throw an IllegalArgumentException.");
70+
assertThrows(IllegalArgumentException.class, () -> WineProblem.wpbu(wines), "The maximum profit for no wines should throw an IllegalArgumentException.");
7771
}
7872
}

0 commit comments

Comments
 (0)