feat: Enhance volume indicators with ADOSC and SSF implementation and validation

This commit is contained in:
Miha Kralj
2025-12-20 15:08:07 -08:00
parent 5549c7329a
commit d21fea3c18
85 changed files with 5144 additions and 3954 deletions
+54
View File
@@ -170,4 +170,58 @@ public class T3Tests
Assert.Throws<ArgumentException>(() => new T3(0));
Assert.Throws<ArgumentException>(() => new T3(-1));
}
private class TestPublisher : ITValuePublisher
{
public event Action<TValue>? Pub;
public int SubscriberCount => Pub?.GetInvocationList().Length ?? 0;
public void Publish(TValue item)
{
Pub?.Invoke(item);
}
}
[Fact]
public void Constructor_SubscribesToSource()
{
var source = new TestPublisher();
var t3 = new T3(source, 5);
Assert.Equal(1, source.SubscriberCount);
}
[Fact]
public void Dispose_UnsubscribesFromSource()
{
var source = new TestPublisher();
var t3 = new T3(source, 5);
Assert.Equal(1, source.SubscriberCount);
t3.Dispose();
Assert.Equal(0, source.SubscriberCount);
}
[Fact]
public void Dispose_CanBeCalledMultipleTimes()
{
var source = new TestPublisher();
var t3 = new T3(source, 5);
t3.Dispose();
t3.Dispose();
Assert.Equal(0, source.SubscriberCount);
}
[Fact]
public void Dispose_DoesNothing_WhenNoSource()
{
var t3 = new T3(5);
// Should not throw
t3.Dispose();
}
}