From 5fb1e837aaf51a4afaf83da9de8ed30fb2b9f9c2 Mon Sep 17 00:00:00 2001 From: Dave Skender <8432125+DaveSkender@users.noreply.github.com> Date: Sun, 1 Dec 2024 02:15:36 -0500 Subject: [PATCH 1/2] chore: Code cleanup (#1283) --- src/_common/Generics/Transforms.cs | 2 +- src/_common/ObsoleteV2.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_common/Generics/Transforms.cs b/src/_common/Generics/Transforms.cs index 2e7385dc9..6ecf5ad65 100644 --- a/src/_common/Generics/Transforms.cs +++ b/src/_common/Generics/Transforms.cs @@ -4,7 +4,7 @@ namespace Skender.Stock.Indicators; // GENERIC TRANSFORMS -public static class Transforms +internal static class Transforms { // TO COLLECTION internal static Collection ToCollection(this IEnumerable source) diff --git a/src/_common/ObsoleteV2.cs b/src/_common/ObsoleteV2.cs index 15a6dca2f..2c2d4bd74 100644 --- a/src/_common/ObsoleteV2.cs +++ b/src/_common/ObsoleteV2.cs @@ -10,7 +10,7 @@ public static partial class Indicator // 2.4.1 [ExcludeFromCodeCoverage] - [Obsolete("Rename 'ToBasicTuple(..)' to 'ToTuple(..)' to fix.", false)] + [Obsolete("'ToBasicTuple(..)' was deprecated.", false)] public static List<(DateTime, double)> ToBasicTuple( this IEnumerable quotes, CandlePart candlePart) From 0df1f2b16e738826ba67820fac8df843dfbd2b6a Mon Sep 17 00:00:00 2001 From: Dave Skender <8432125+DaveSkender@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:20:26 -0500 Subject: [PATCH 2/2] test: Rename test namespaces (#1288) --- tests/indicators/_common/Generics/Transforms.Tests.cs | 2 +- tests/indicators/_common/Math/NullMath.Tests.cs | 4 ++-- tests/indicators/_common/Math/Numerix.Tests.cs | 2 +- tests/indicators/_common/Quotes/Quote.Exceptions.Tests.cs | 2 +- tests/other/Convergence.Tests.cs | 2 +- tests/other/CustomIndicator.Tests.cs | 4 ++-- tests/other/PublicApi.Tests.cs | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/indicators/_common/Generics/Transforms.Tests.cs b/tests/indicators/_common/Generics/Transforms.Tests.cs index 8c398518f..ab9776097 100644 --- a/tests/indicators/_common/Generics/Transforms.Tests.cs +++ b/tests/indicators/_common/Generics/Transforms.Tests.cs @@ -3,7 +3,7 @@ namespace Tests.Common; [TestClass] -public class TransformTests : TestBase +public class Transforms : TestBase { [TestMethod] public void ToCollection() diff --git a/tests/indicators/_common/Math/NullMath.Tests.cs b/tests/indicators/_common/Math/NullMath.Tests.cs index 86b72ab03..19d720a31 100644 --- a/tests/indicators/_common/Math/NullMath.Tests.cs +++ b/tests/indicators/_common/Math/NullMath.Tests.cs @@ -1,9 +1,9 @@ -namespace Utilities; +namespace Tests.Common; #pragma warning disable CA1805 // Do not initialize unnecessarily [TestClass] -public class NullMathTests : TestBase +public class NullMaths : TestBase { private readonly double? dblPos = 100.12345; private readonly double? dblNeg = -200.98765; diff --git a/tests/indicators/_common/Math/Numerix.Tests.cs b/tests/indicators/_common/Math/Numerix.Tests.cs index a8cc81498..c0bed4286 100644 --- a/tests/indicators/_common/Math/Numerix.Tests.cs +++ b/tests/indicators/_common/Math/Numerix.Tests.cs @@ -1,7 +1,7 @@ namespace Tests.Common; [TestClass] -public class NumerixTests : TestBase +public class Numerixs : TestBase { private readonly double[] closePrice = longishQuotes .Select(x => (double)x.Close) diff --git a/tests/indicators/_common/Quotes/Quote.Exceptions.Tests.cs b/tests/indicators/_common/Quotes/Quote.Exceptions.Tests.cs index 5a546b482..0a334d2b9 100644 --- a/tests/indicators/_common/Quotes/Quote.Exceptions.Tests.cs +++ b/tests/indicators/_common/Quotes/Quote.Exceptions.Tests.cs @@ -1,7 +1,7 @@ namespace Tests.Common; [TestClass] -public class ExceptionTests : TestBase +public class CustomExceptions : TestBase { // bad quotes exceptions [TestMethod] diff --git a/tests/other/Convergence.Tests.cs b/tests/other/Convergence.Tests.cs index cace80bc0..a3dd8b4e6 100644 --- a/tests/other/Convergence.Tests.cs +++ b/tests/other/Convergence.Tests.cs @@ -1,7 +1,7 @@ namespace Tests.Convergence; [TestClass] -public class ConvergenceTests : TestBase +public class Convergences : TestBase { private static readonly int[] QuotesQuantities = [5, 14, 28, 40, 50, 75, 100, 110, 120, 130, 140, 150, 160, 175, 200, 250, 350, 500, 600, 700, 800, 900, 1000]; diff --git a/tests/other/CustomIndicator.Tests.cs b/tests/other/CustomIndicator.Tests.cs index 328909e2f..7d2e45388 100644 --- a/tests/other/CustomIndicator.Tests.cs +++ b/tests/other/CustomIndicator.Tests.cs @@ -1,7 +1,7 @@ using System.Collections.ObjectModel; using System.Globalization; -namespace Tests.CustomIndicators; +namespace Tests.Customizations; public sealed class MyResult : ResultBase, IReusableResult { @@ -80,7 +80,7 @@ internal static List CalcIndicator( } [TestClass] -public class CustomIndicatorTests +public class CustomIndicators { private static readonly CultureInfo EnglishCulture = new("en-US", false); diff --git a/tests/other/PublicApi.Tests.cs b/tests/other/PublicApi.Tests.cs index 7ffe5f564..a6a777106 100644 --- a/tests/other/PublicApi.Tests.cs +++ b/tests/other/PublicApi.Tests.cs @@ -33,7 +33,7 @@ internal sealed class MyGenericQuote : IQuote } [TestClass] -public class PublicClassTests +public class PublicClasses { internal static readonly CultureInfo EnglishCulture = new("en-US", false);