feat: Implement Ehlers Ultimate Smoother Filter (USF) with documentation and tests

This commit is contained in:
Miha Kralj
2025-12-20 15:57:38 -08:00
parent d21fea3c18
commit 54c309e5cf
10 changed files with 661 additions and 14 deletions
+5 -8
View File
@@ -175,18 +175,13 @@ public class T3Tests
{
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);
_ = new T3(source, 5);
Assert.Equal(1, source.SubscriberCount);
}
@@ -211,7 +206,9 @@ public class T3Tests
var t3 = new T3(source, 5);
t3.Dispose();
#pragma warning disable S3966 // Objects should not be disposed more than once
t3.Dispose();
#pragma warning restore S3966 // Objects should not be disposed more than once
Assert.Equal(0, source.SubscriberCount);
}
@@ -221,7 +218,7 @@ public class T3Tests
{
var t3 = new T3(5);
// Should not throw
t3.Dispose();
var exception = Record.Exception(() => t3.Dispose());
Assert.Null(exception);
}
}