Skip to content

Commit 020489d

Browse files
committed
Fix unit tests
1 parent 9fe8301 commit 020489d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

Tests/Algorithm/AlgorithmAddSecurityTests.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -576,14 +576,7 @@ def set_brokerage_model(algorithm):
576576
// All models should've been set my the TestBrokerageModel, except the fill model,
577577
// which should have been set by the TestCustomSecurityInitializer, because user defined
578578
// initializer should run after the brokerage model initializer
579-
if (language == Language.CSharp)
580-
{
581-
Assert.IsInstanceOf<TestCustomSecurityInitializer.TestFillModel>(security.FillModel);
582-
}
583-
else
584-
{
585-
Assert.IsInstanceOf<FillModelPythonWrapper>(security.FillModel);
586-
}
579+
Assert.IsInstanceOf<TestCustomSecurityInitializer.TestFillModel>(security.FillModel);
587580
}
588581

589582
public class TestCustomSecurityInitializer : ISecurityInitializer

Tests/Python/SecurityCustomModelTests.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
using QuantConnect.Tests.Common.Securities;
2626
using System;
2727
using QuantConnect.Tests.Engine.DataFeeds;
28+
using System.Reflection;
2829

2930
namespace QuantConnect.Tests.Python
3031
{
@@ -70,7 +71,7 @@ public void SetBuyingPowerModelFails()
7071
var code = CreateCustomBuyingPowerModelCode();
7172
code = code.Replace("GetMaximumOrderQuantityForDeltaBuyingPower", "AnotherName");
7273
var pyObject = CreateCustomBuyingPowerModel(code);
73-
Assert.Throws<NotImplementedException>(() => spy.SetBuyingPowerModel(pyObject));
74+
Assert.Throws<TargetInvocationException>(() => spy.SetBuyingPowerModel(pyObject));
7475
}
7576

7677
private PyObject CreateCustomBuyingPowerModel(string code)

0 commit comments

Comments
 (0)