* Move PrivateKeys.cs * Update gitignore * Update gitignore * updt * Extract GmxServiceTests.cs * Refact * update todo * Update code * Fix hashdata * Replace static token hashed datas * Set allowance * Add get orders * Add get orders tests * Add ignore * add close orders * revert * Add get gas limit * Start increasePosition. Todo: Finish GetExecutionFee and estimateGas * little refact * Update gitignore * Fix namespaces and clean repo * Add tests samples * Add execution fee * Add increase position * Handle backtest on the frontend * Add tests * Update increase * Test increase * fix increase * Fix size * Start get position * Update get positions * Fix get position * Update rpc and trade mappers * Finish close position * Fix leverage
54 lines
1.5 KiB
C#
54 lines
1.5 KiB
C#
using Managing.Domain.Workflows;
|
|
using Xunit;
|
|
using static Managing.Common.Enums;
|
|
|
|
namespace Managing.Application.Tests;
|
|
|
|
public class WorkflowTests : BaseTests
|
|
{
|
|
[Fact]
|
|
public async Task Should_Create_Workflow_with_Feed_Ticker_Flow()
|
|
{
|
|
// Arrange
|
|
var workflow = new Workflow
|
|
{
|
|
Name = "Bot trading",
|
|
Usage = WorkflowUsage.Trading,
|
|
Description = "Basic trading Workflow",
|
|
Flows = new List<IFlow>()
|
|
};
|
|
|
|
// var rsiDivFlow = new RsiDiv()
|
|
// {
|
|
// Parameters = "{\"Period\": 14,\"Timeframe\":1}",
|
|
// Children = new List<IFlow>(),
|
|
// };
|
|
|
|
// var tickerFlow = new FeedTicker(_exchangeService)
|
|
// {
|
|
// Parameters = "{\"Exchange\": 3,\"Ticker\":9,\"Timeframe\":1}",
|
|
// Children = new List<IFlow>()
|
|
// {
|
|
// rsiDivFlow
|
|
// }
|
|
// };
|
|
|
|
// workflow.Flows.Add(tickerFlow);
|
|
|
|
// Act
|
|
await workflow.Execute();
|
|
|
|
// Assert
|
|
foreach (var f in workflow.Flows)
|
|
{
|
|
Assert.False(string.IsNullOrEmpty(f.Output));
|
|
}
|
|
|
|
Assert.NotNull(workflow);
|
|
Assert.NotNull(workflow.Flows);
|
|
Assert.Single(workflow.Flows);
|
|
Assert.Equal("Feed Ticker", workflow.Name);
|
|
Assert.Equal(WorkflowUsage.Trading, workflow.Usage);
|
|
Assert.Equal("Basic trading Workflow", workflow.Description);
|
|
}
|
|
} |