52 lines
1.7 KiB
C#
52 lines
1.7 KiB
C#
using Managing.Application.Abstractions.Services;
|
|
using Managing.Application.Abstractions;
|
|
using Moq;
|
|
using Managing.Domain.MoneyManagements;
|
|
using static Managing.Common.Enums;
|
|
using Managing.Domain.Accounts;
|
|
|
|
namespace Managing.Application.Tests;
|
|
|
|
public class BaseTests
|
|
{
|
|
public readonly Mock<IMoneyManagementService> _moneyManagementService;
|
|
public readonly Mock<IAccountService> _accountService;
|
|
public readonly IExchangeService _exchangeService;
|
|
public readonly Mock<ITradingService> _tradingService;
|
|
public readonly Account Account;
|
|
public readonly MoneyManagement MoneyManagement;
|
|
|
|
public const string PublicAddress = "0x0425dEAb364E9121F7CA284129dA854FD5cF22eD";
|
|
public const string PrivateKey = "";
|
|
|
|
public BaseTests()
|
|
{
|
|
_accountService = new Mock<IAccountService>();
|
|
_moneyManagementService = new Mock<IMoneyManagementService>();
|
|
MoneyManagement = new MoneyManagement()
|
|
{
|
|
BalanceAtRisk = 0.30m,
|
|
Leverage = 2,
|
|
Timeframe = Timeframe.FifteenMinutes,
|
|
StopLoss = 0.008m,
|
|
TakeProfit = 0.02m,
|
|
Name = "Default MM"
|
|
};
|
|
|
|
_ =_moneyManagementService.Setup(m => m.GetMoneyMangement(It.IsAny<string>())).Returns(Task.FromResult(MoneyManagement));
|
|
|
|
Account = new Account()
|
|
{
|
|
Exchange = TradingExchanges.Evm,
|
|
Key = PublicAddress,
|
|
Secret = PrivateKey,
|
|
};
|
|
|
|
_accountService.Setup(a => a.GetAccount(It.IsAny<string>(), It.IsAny<bool>(), It.IsAny<bool>()))
|
|
.Returns(Task.FromResult(Account));
|
|
|
|
_tradingService = new Mock<ITradingService>();
|
|
_exchangeService = TradingBaseTests.GetExchangeService();
|
|
}
|
|
}
|