Files
QuanTAlib/lib/momentum/rocr/Rocr.Quantower.Tests.cs
T
Miha Kralj 915d7a007b Add Standardize class for Z-Score normalization and update project files
- Implemented the Standardize class for calculating Z-Score normalization over a specified lookback period.
- Updated NDepend badge SVG files to reflect new metrics.
- Modified NDepend project files to reference the updated solution file name.
- Removed outdated documentation files related to indicator proposals and channel documentation remediation.
- Updated workspace configuration to point to the new solution file.
2026-02-07 12:47:13 -08:00

53 lines
1.3 KiB
C#

using TradingPlatform.BusinessLayer;
using Xunit;
namespace QuanTAlib.Tests;
public class RocrIndicatorTests
{
[Fact]
public void Constructor_InitializesDefaults()
{
var indicator = new RocrIndicator();
Assert.Equal(9, indicator.Period);
Assert.Equal(SourceType.Close, indicator.Source);
Assert.True(indicator.ShowColdValues);
Assert.Equal("ROCR - Rate of Change Ratio", indicator.Name);
}
[Fact]
public void ShortName_ReflectsPeriod()
{
var indicator = new RocrIndicator { Period = 14 };
Assert.Equal("ROCR(14)", indicator.ShortName);
}
[Fact]
public void MinHistoryDepths_IsPeriodPlusOne()
{
var indicator = new RocrIndicator { Period = 9 };
Assert.Equal(10, indicator.MinHistoryDepths);
}
[Fact]
public void Period_CanBeSet()
{
var indicator = new RocrIndicator { Period = 20 };
Assert.Equal(20, indicator.Period);
}
[Fact]
public void Source_CanBeSet()
{
var indicator = new RocrIndicator { Source = SourceType.Open };
Assert.Equal(SourceType.Open, indicator.Source);
}
[Fact]
public void ShowColdValues_CanBeSet()
{
var indicator = new RocrIndicator { ShowColdValues = false };
Assert.False(indicator.ShowColdValues);
}
}