mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-16 09:38:05 +00:00
Refactor tests and project files for improved consistency and clarity
This commit is contained in:
@@ -33,8 +33,8 @@ public class ConvIndicatorTests
|
||||
{
|
||||
var indicator = new ConvIndicator();
|
||||
|
||||
Assert.Contains("CONV", indicator.ShortName);
|
||||
Assert.Contains("Close", indicator.ShortName);
|
||||
Assert.Contains("CONV", indicator.ShortName, StringComparison.Ordinal);
|
||||
Assert.Contains("Close", indicator.ShortName, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -42,8 +42,8 @@ public class ConvIndicatorTests
|
||||
{
|
||||
var indicator = new ConvIndicator();
|
||||
|
||||
Assert.Contains("github.com", indicator.SourceCodeLink);
|
||||
Assert.Contains("Conv.Quantower.cs", indicator.SourceCodeLink);
|
||||
Assert.Contains("github.com", indicator.SourceCodeLink, StringComparison.Ordinal);
|
||||
Assert.Contains("Conv.Quantower.cs", indicator.SourceCodeLink, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -172,6 +172,6 @@ public class ConvIndicatorTests
|
||||
{
|
||||
var indicator = new ConvIndicator();
|
||||
|
||||
Assert.Contains("Convolution", indicator.Description);
|
||||
Assert.Contains("Convolution", indicator.Description, StringComparison.Ordinal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,13 +43,10 @@ public class ConvIndicator : Indicator, IWatchlistIndicator
|
||||
try
|
||||
{
|
||||
var weights = WeightsInput.Split(',')
|
||||
.Select(s => double.Parse(s.Trim()))
|
||||
.Select(s => double.Parse(s.Trim(), System.Globalization.CultureInfo.InvariantCulture))
|
||||
.ToArray();
|
||||
|
||||
if (weights.Length == 0)
|
||||
throw new ArgumentException("Weights cannot be empty");
|
||||
|
||||
_conv = new Conv(weights);
|
||||
_conv = new Conv(weights.Length == 0 ? [1.0] : weights);
|
||||
}
|
||||
catch (FormatException)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user