test: cover GAP-038 BarsPeriod config hash input
This commit is contained in:
41
tests/NT8.Integration.Tests/ConfigHashTests.cs
Normal file
41
tests/NT8.Integration.Tests/ConfigHashTests.cs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||||
|
using NT8.Adapters;
|
||||||
|
|
||||||
|
namespace NT8.Integration.Tests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class ConfigHashTests
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void Compute_DifferentBarsPeriodInputs_ProducesDifferentHashes()
|
||||||
|
{
|
||||||
|
List<string> first = CreateBaseInputs();
|
||||||
|
first.Add("BarsPeriodValue=15");
|
||||||
|
first.Add("BarsPeriodType=Minute");
|
||||||
|
|
||||||
|
List<string> second = CreateBaseInputs();
|
||||||
|
second.Add("BarsPeriodValue=5");
|
||||||
|
second.Add("BarsPeriodType=Minute");
|
||||||
|
|
||||||
|
string firstHash = ConfigHashCalculator.Compute(first);
|
||||||
|
string secondHash = ConfigHashCalculator.Compute(second);
|
||||||
|
|
||||||
|
Assert.AreNotEqual(firstHash, secondHash);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static List<string> CreateBaseInputs()
|
||||||
|
{
|
||||||
|
List<string> inputs = new List<string>();
|
||||||
|
inputs.Add("StrategyName=Simple ORB NT8");
|
||||||
|
inputs.Add("Description=v0.4.0");
|
||||||
|
inputs.Add("Account=SimSimple ORB");
|
||||||
|
inputs.Add("Instrument=NQ SEP26");
|
||||||
|
inputs.Add("BarsRequiredToTrade=50");
|
||||||
|
inputs.Add("Calculate=OnBarClose");
|
||||||
|
inputs.Add("MinTradeGrade=5");
|
||||||
|
inputs.Add("MaxDailyTrades=1");
|
||||||
|
return inputs;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user