1/4 of the changes of RegressionTestException (#8100)
Regression Tests / build (push) Has been cancelled
Report Generator Tests / build (push) Has been cancelled
Research Regression Tests / build (push) Has been cancelled
API Tests / build (push) Has been cancelled
Benchmarks / build (push) Has been cancelled
Build & Test Lean / build (push) Has been cancelled
Python Virtual Environments / build (push) Has been cancelled

This commit is contained in:
Ricardo Andrés Marino Rojas
2024-06-24 13:23:33 -05:00
committed by GitHub
parent 5432c7c6d8
commit b41df5b0f2
105 changed files with 443 additions and 396 deletions
@@ -76,24 +76,24 @@ namespace QuantConnect.Algorithm.CSharp
var customData = slice.Get<ExampleCustomData>(_customSymbol);
if (customData.Price == 0)
{
throw new Exception("Custom data price was not expected to be zero");
throw new RegressionTestException("Custom data price was not expected to be zero");
}
var customData2 = CurrentSlice.Get<ExampleCustomData>(_customSymbol);
if (customData2.Price == 0)
{
throw new Exception("Custom data 2 price was not expected to be zero");
throw new RegressionTestException("Custom data 2 price was not expected to be zero");
}
// accessing by symbol
customData = slice.Get<ExampleCustomData>()[_customSymbol];
if (customData.Price == 0)
{
throw new Exception("Custom data price was not expected to be zero, index access");
throw new RegressionTestException("Custom data price was not expected to be zero, index access");
}
customData2 = CurrentSlice.Get<ExampleCustomData>()[_customSymbol];
if (customData2.Price == 0)
{
throw new Exception("Custom data 2 price was not expected to be zero, index access");
throw new RegressionTestException("Custom data 2 price was not expected to be zero, index access");
}
_receivedData.Add(customData);
@@ -104,13 +104,13 @@ namespace QuantConnect.Algorithm.CSharp
{
if (_receivedData.Count == 0)
{
throw new Exception("Custom data was not fetched");
throw new RegressionTestException("Custom data was not fetched");
}
var customSecurity = Securities[_customSymbol];
if (customSecurity == null || customSecurity.Price == 0)
{
throw new Exception("Expected the custom security to be added to the algorithm securities and to have a price that is not zero");
throw new RegressionTestException("Expected the custom security to be added to the algorithm securities and to have a price that is not zero");
}
// Make sure history requests work as expected
@@ -118,14 +118,14 @@ namespace QuantConnect.Algorithm.CSharp
if (history.Count != _receivedData.Count)
{
throw new Exception("History request returned different data than expected");
throw new RegressionTestException("History request returned different data than expected");
}
for (var i = 0; i < history.Count; i++)
{
if (!history[i].Equals(_receivedData[i]))
{
throw new Exception("History request returned different data than expected");
throw new RegressionTestException("History request returned different data than expected");
}
}
}