Improve gateway reliability and client e2e coverage
This commit is contained in:
@@ -60,4 +60,22 @@ public sealed class GatewayMetricsTests
|
||||
|
||||
Assert.Equal("depth", exception.ParamName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void RemoveSessionEvents_RemovesOnlyThatSession()
|
||||
{
|
||||
using GatewayMetrics metrics = new();
|
||||
|
||||
metrics.EventReceived("session-1", "OnDataChange");
|
||||
metrics.EventReceived("session-2", "OnWriteComplete");
|
||||
metrics.RemoveSessionEvents("session-1");
|
||||
|
||||
GatewayMetricsSnapshot snapshot = metrics.GetSnapshot();
|
||||
|
||||
Assert.Equal(2, snapshot.EventsReceived);
|
||||
Assert.False(snapshot.EventsBySession.ContainsKey("session-1"));
|
||||
Assert.Equal(1, snapshot.EventsBySession["session-2"]);
|
||||
Assert.Equal(1, snapshot.EventsByFamily["OnDataChange"]);
|
||||
Assert.Equal(1, snapshot.EventsByFamily["OnWriteComplete"]);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user