diff --git a/Account/AccountBase.h b/Account/AccountBase.h index 5cb522e24..359d4c0ed 100644 --- a/Account/AccountBase.h +++ b/Account/AccountBase.h @@ -57,6 +57,8 @@ class AccountBase : public Dynamic { */ ~AccountBase() {} + /* Virtual methods */ + /** * Returns balance value of the current account. */ diff --git a/Account/tests/Account.test.mq5 b/Account/tests/Account.test.mq5 index 67b1ca128..605896215 100644 --- a/Account/tests/Account.test.mq5 +++ b/Account/tests/Account.test.mq5 @@ -28,12 +28,51 @@ #include "../../Test.mqh" #include "../Account.h" + +// Test classes. +class AccountTest : public Account { + /** + * Returns balance value of the current account. + */ + float GetBalance() { return 0; } + + /** + * Returns credit value of the current account. + */ + float GetCredit() { return 0; } + + /** + * Returns profit value of the current account. + */ + float GetProfit() { return 0; } + + /** + * Returns equity value of the current account. + */ + float GetEquity() { return 0; } + + /** + * Returns margin value of the current account. + */ + float GetMarginUsed() { return 0; } + + /** + * Returns free margin value of the current account. + */ + float GetMarginFree() { return 0; } + + /** + * Get account available margin. + */ + float GetMarginAvail() { return 0; } +}; + /** * Implements OnInit(). */ int OnInit() { bool _result = true; - Account acc1; + AccountTest acc1; // ... return _result && GetLastError() == 0 ? INIT_SUCCEEDED : INIT_FAILED; } diff --git a/Exchange/tests/Exchange.test.mq5 b/Exchange/tests/Exchange.test.mq5 index d3d289c61..498c0c791 100644 --- a/Exchange/tests/Exchange.test.mq5 +++ b/Exchange/tests/Exchange.test.mq5 @@ -30,7 +30,43 @@ #include "../Exchange.h" // Test classes. -class AccountDummy : public AccountBase {}; // +class AccountDummy : public AccountBase { + /** + * Returns balance value of the current account. + */ + float GetBalance() { return 0; } + + /** + * Returns credit value of the current account. + */ + float GetCredit() { return 0; } + + /** + * Returns profit value of the current account. + */ + float GetProfit() { return 0; } + + /** + * Returns equity value of the current account. + */ + float GetEquity() { return 0; } + + /** + * Returns margin value of the current account. + */ + float GetMarginUsed() { return 0; } + + /** + * Returns free margin value of the current account. + */ + float GetMarginFree() { return 0; } + + /** + * Get account available margin. + */ + float GetMarginAvail() { return 0; } +}; + class ExchangeDummy : public Exchange {}; class SymbolDummy : public SymbolInfo {}; class TradeDummy : public Trade {