Skip to content

Commit

Permalink
feat: additional orderType in CrossZeroOrder tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Romazes committed Jun 11, 2024
1 parent 9366367 commit 42df918
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions Tests/Brokerages/OrderCrossingBrokerageTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ private static IEnumerable<TestCaseData> OrderParameters
{
get
{
var stopMarketOrder = new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10));
yield return new TestCaseData(stopMarketOrder, new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Filled });
var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Filled };
yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
}
}

Expand Down Expand Up @@ -120,8 +123,11 @@ private static IEnumerable<TestCaseData> OrderUpdateParameters
{
get
{
var stopMarketOrder = new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10));
yield return new TestCaseData(stopMarketOrder, new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.UpdateSubmitted, OrderStatus.Filled });
var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.UpdateSubmitted, OrderStatus.Filled };
yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
}
}

Expand Down Expand Up @@ -192,8 +198,11 @@ private static IEnumerable<TestCaseData> CrossZeroInvalidFirstPartParameters
{
get
{
var stopMarketOrder = new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10));
yield return new TestCaseData(stopMarketOrder, new[] { OrderStatus.Submitted, OrderStatus.Invalid });
var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.Invalid };
yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
}
}

Expand Down Expand Up @@ -235,8 +244,11 @@ private static IEnumerable<TestCaseData> OrderCrossZeroSecondPartParameters
{
get
{
var stopMarketOrder = new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10));
yield return new TestCaseData(stopMarketOrder, new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Canceled });
var expectedOrderStatusChangedOrdering = new[] { OrderStatus.Submitted, OrderStatus.PartiallyFilled, OrderStatus.Canceled };
yield return new TestCaseData(new MarketOrder(Symbols.AAPL, -15, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new LimitOrder(Symbols.AAPL, -15, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopMarketOrder(Symbols.AAPL, -20, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
yield return new TestCaseData(new StopLimitOrder(Symbols.AAPL, -15, 180m, 180m, new DateTime(2024, 6, 10)), expectedOrderStatusChangedOrdering);
}
}

Expand Down

0 comments on commit 42df918

Please sign in to comment.