Assertion error in module 3

Task :qmoney:pmdMain
This analysis could be faster, please consider using Incremental Analysis: https://pmd.github.io/pmd-6.10.0/pmd_userdocs_incremental_analy
sis.html
20 PMD rule violations were found. See the report at: file:///home/crio-user/workspace/snigdhabhosle-ME_QMONEY/qmoney/build/reports/pmd/ma
in.html

Task :qmoney:test

com.crio.warmup.stock.PortfolioManagerApplicationTest > testAllDebugValues() FAILED
org.opentest4j.AssertionFailedError at PortfolioManagerApplicationTest.java:87

com.crio.warmup.stock.PortfolioManagerApplicationTest > mainCalculateAnnualReturn() FAILED
org.opentest4j.AssertionFailedError at PortfolioManagerApplicationTest.java:56

TEST RESULT: FAILURE
TEST SUMMARY: RAN 12 TESTS, 10 SUCCEEDED, 2 FAILED, 0 SKIPPED

12 tests completed, 2 failed

Task :qmoney:test FAILED

We used testAllDebugValues() in Module 1. You might have edited the code inside this function.
Verify it once.

For mainCalculateAnnualReturn(), use debugger and find out if you’re miscalculating anything.
Make sure you are calculating number of years properly.
And also check if you are passing correct BuyPrice and SellPrice.
open of StartDate is your BuyPrice. close of EndDate is your SellPrice.

If everything is calculated properly, you might have made a small logical mistake somewhere. Use debugger to find it.

Also refer this: Test invalid stock is failing, tried every possibility

TestAllDebug values is the testcase which compares the values obtained from the debugging task done in Module 1, can you check again if you have done that properly?

For mainCalculateannualized return, make sure you have done the calculation properly.

  1. If you’re failing testAllDebugValues() then might be a case you accepted all the incoming changes which leads you to this error. Means in each new module your previous module test cases are checked so it is recommended don’t over write or modify any previous function functionality.

  2. If you’re failing in mainCalculateAnnualReturn(). Then case is you’re not calculating annual return in proper way. Just read the below article and use this formula.

Hey @BhosleSnigdha, As there is no response from your side on this topic for a long time, Hoping that your issue is resolved, I am closing this topic.

If the issue still exists, you can create a new topic and continue the discussion there with this topic link in the description.