refactor: update NoWarn codes and clean up EmaValidationTests and EmaVectorTests

This commit is contained in:
Miha Kralj
2025-11-29 17:04:56 -08:00
parent 622e4c8ae6
commit ce77bc9c85
3 changed files with 67 additions and 72 deletions
+1 -1
View File
@@ -44,7 +44,7 @@
</PropertyGroup> </PropertyGroup>
<PropertyGroup> <PropertyGroup>
<NoWarn>S1944,S2053,S2222,S2259,S2583,S2589,S3329,S3655,S3776,S3900,S3949,S3966,S4158,S4347,S5773,S6781</NoWarn> <NoWarn>S1144,S1944,S2053,S2222,S2259,S2583,S2589,S3329,S3655,S3776,S3900,S3949,S3966,S4158,S4347,S5773,S6781</NoWarn>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
+1 -6
View File
@@ -10,7 +10,7 @@ using QuanTAlib;
namespace QuanTAlib.Tests; namespace QuanTAlib.Tests;
public class EmaValidationTests : IDisposable public class EmaValidationTests
{ {
private readonly TBarSeries _bars; private readonly TBarSeries _bars;
private readonly TSeries _data; private readonly TSeries _data;
@@ -45,11 +45,6 @@ public class EmaValidationTests : IDisposable
} }
} }
public void Dispose()
{
// Cleanup if needed
}
[Fact] [Fact]
public void Validate_Skender() public void Validate_Skender()
{ {
+5 -5
View File
@@ -38,7 +38,7 @@ public class EmaVectorTests
{ {
int[] periods = { 10, 0, 20 }; int[] periods = { 10, 0, 20 };
Assert.Throws<ArgumentException>(() => new EmaVector(periods)); Assert.Throws<ArgumentOutOfRangeException>(() => new EmaVector(periods));
} }
[Fact] [Fact]
@@ -46,7 +46,7 @@ public class EmaVectorTests
{ {
int[] periods = { 10, -5, 20 }; int[] periods = { 10, -5, 20 };
Assert.Throws<ArgumentException>(() => new EmaVector(periods)); Assert.Throws<ArgumentOutOfRangeException>(() => new EmaVector(periods));
} }
[Fact] [Fact]
@@ -54,7 +54,7 @@ public class EmaVectorTests
{ {
double[] alphas = { 0.1, 0.0, 0.5 }; double[] alphas = { 0.1, 0.0, 0.5 };
Assert.Throws<ArgumentException>(() => new EmaVector(alphas)); Assert.Throws<ArgumentOutOfRangeException>(() => new EmaVector(alphas));
} }
[Fact] [Fact]
@@ -62,7 +62,7 @@ public class EmaVectorTests
{ {
double[] alphas = { 0.1, -0.1, 0.5 }; double[] alphas = { 0.1, -0.1, 0.5 };
Assert.Throws<ArgumentException>(() => new EmaVector(alphas)); Assert.Throws<ArgumentOutOfRangeException>(() => new EmaVector(alphas));
} }
[Fact] [Fact]
@@ -70,7 +70,7 @@ public class EmaVectorTests
{ {
double[] alphas = { 0.1, 1.5, 0.5 }; double[] alphas = { 0.1, 1.5, 0.5 };
Assert.Throws<ArgumentException>(() => new EmaVector(alphas)); Assert.Throws<ArgumentOutOfRangeException>(() => new EmaVector(alphas));
} }
[Fact] [Fact]