Skip to content

Commit

Permalink
Merge pull request #115 from wwweert123/FIxTestStock
Browse files Browse the repository at this point in the history
Fix Junit for stock delete
  • Loading branch information
wwweert123 authored Oct 27, 2023
2 parents 646af54 + 2177331 commit d928fba
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
package seedu.financialplanner.investments;

import org.junit.jupiter.api.MethodOrderer;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
import seedu.financialplanner.exceptions.FinancialPlannerException;

import java.util.ArrayList;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;

@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
class WatchListTest {

@Test
@Order(1)
void fetchFMPStockPrices() throws FinancialPlannerException {
WatchList wl = WatchList.getInstance();
wl.fetchFMPStockPrices();
Expand All @@ -20,16 +25,18 @@ void fetchFMPStockPrices() throws FinancialPlannerException {
}

@Test
@Order(2)
void addStock() throws Exception {
WatchList wl = WatchList.getInstance();
String stockCode = "GME";
assertEquals("Gamestop Corporation - Class A", wl.addStock(stockCode));
}

@Test
@Order(3)
void deleteStock() throws FinancialPlannerException {
WatchList wl = WatchList.getInstance();
String stockCode = "AAPL";
assertEquals("Apple Inc", wl.deleteStock(stockCode));
String stockCode = "GME";
assertEquals("Gamestop Corporation - Class A", wl.deleteStock(stockCode));
}
}

0 comments on commit d928fba

Please sign in to comment.