Closed alexpung closed 2 months ago
The changes introduce a new method, AttachTradeToUnderlying
, in the OptionTradeTaxCalculation
class to enhance the organization of option trade handling. The UkOptionTradeCalculator
file is updated to clarify tax implications for exercised and assigned options, streamlining the logic for premium costs. New unit tests are added for option assignment trades, and existing tests are modified to support parameterized testing. Overall, the updates improve code clarity and structure in the investment tax calculation framework.
File Path | Change Summary |
---|---|
.../Options/OptionTradeTaxCalculation.cs |
Added method AttachTradeToUnderlying for improved trade attachment logic; refactored inline logic. |
.../Options/UkOptionTradeCalculator.cs |
Updated comments and logic in MatchExercisedOption and MatchAssignedOption for clarity; replaced conditional logic with AttachTradeToUnderlying . |
UnitTest/Test/TradeCalculations/Options/UkTradeCalculatorOptionAssignmentTest.cs |
Introduced new unit test class UkTradeCalculatorOptionAssignmentTest with a parameterized test method for short put options. |
UnitTest/Test/TradeCalculations/Options/UkTradeCalculatorOptionExerciseTest.cs |
Changed two test methods to support parameterized testing with option dates. |
UnitTest/Test/TradeCalculations/Options/UkTradeCalculatorOptionExpireTest.cs |
Modified two test methods for parameterized testing with option dates. |
UkOptionTradeCalculator.cs
utilize the new AttachTradeToUnderlying
method, indicating a connection in option trade handling.UkOptionTradeCalculator.cs
regarding exercised options relate to the main PR's processing of option trades.OptionTradeTaxCalculation.cs
refine exercised option handling, aligning with the new AttachTradeToUnderlying
method.🐰 "In the meadow where options play,
New methods hop and dance today.
With tests that leap and bounds that grow,
Clarity shines, as profits flow.
A joyful change in tax we see,
Hooray for trades, as bright as can be!" 🐇
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Summary by CodeRabbit
New Features
Bug Fixes
Tests