[test]: Unit Tests for PortfolioInfo Methods
Open
Nobody has claimed this yet.
easy
test
- Dominant language
- TypeScript
- Stars
- 1
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Description
- Detailed Description:
The utility methods inPortfolioInfohave no tests, leaving potential edge cases (such as an empty list or null values) unchecked. Unit tests are crucial to ensure the methods work as intended. - How to Solve:
- Create a Test Class:
Create a new JUnit test class (e.g.,PortfolioInfoTest) in the test folder. - Write Test Cases:
Write tests for each method. For instance:@Test public void testCalculateTotalPortfolioValue_emptyList() { List<Stock> stocks = new ArrayList<>(); double value = PortfolioInfo.calculateTotalPortfolioValue(stocks); assertEquals(0.0, value, 0.01); } - Test Various Scenarios:
Include tests for normal data, edge cases, and possible erroneous inputs. - Run the Tests:
Execute the test suite and ensure all tests pass.
- Create a Test Class:
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the PortfolioInfo utility and inspect each method and its inputs before creating the requested PortfolioInfoTest JUnit class. Cover normal data, empty lists, null values, and other erroneous inputs mentioned in the issue, then run the project test suite and confirm all tests pass.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring-boot
- Domain
- backend, testing
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100