refactor(net): converge live session state reset

This commit is contained in:
Erik 2026-07-21 12:00:48 +02:00
parent 78a9223b65
commit 4f31a5085f
35 changed files with 1460 additions and 83 deletions

View file

@ -4,6 +4,30 @@ namespace AcDream.Core.Tests.Social;
public sealed class SocialStateTests
{
[Fact]
public void SquelchState_Clear_ReturnsEmptyDatabase()
{
var state = new SquelchState();
state.Replace(new SquelchDatabase(
new Dictionary<string, uint> { ["Account"] = 1u },
new Dictionary<uint, SquelchInfo>
{
[2u] = new("Character", false, new HashSet<uint> { 3u }),
},
new SquelchInfo("Global", true, new HashSet<uint> { 4u })));
state.Clear();
SquelchDatabase snapshot = state.Snapshot();
Assert.Empty(snapshot.Accounts);
Assert.Empty(snapshot.Characters);
Assert.Empty(snapshot.Global.MessageTypes);
Assert.Equal(string.Empty, snapshot.Global.Name);
Assert.False(snapshot.Global.AccountWide);
state.Clear();
Assert.Empty(state.Snapshot().Accounts);
}
[Fact]
public void FriendsState_AppliesRetailIncrementalUpdateKindsByObjectId()
{