mirror of
https://github.com/mihakralj/QuanTAlib.git
synced 2026-08-17 18:18:04 +00:00
feat: Implement Ehlers Ultimate Smoother Filter (USF) with documentation and tests
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user