Unseal the TradeResult Class so that we can unit test please

Created at 13 Dec 2023, 19:48
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
TH

thomas.myinvestments

Joined 13.12.2023

Unseal the TradeResult Class so that we can unit test please
13 Dec 2023, 19:48


Hi guys

So it seems as though unit testing isn't all that common for cAlgo, but our team are writing unit tests for our bots, and we are now running into a problem. We can't mock out “PlaceStopOrder” because the TradeResult class is a sealed class.

Could you please look into unsealing that class? We can't see the need to have that class sealed when every other class we found isn't sealed.

Or could we maybe get a solution to how to effectively mock out that method and its properties like “IsSuccessfull” and Cancel()


@thomas.myinvestments