Add persistent Inbox and RFC 8291/8292 Web Push notification system
This commit is contained in:
parent
4714d25724
commit
7cc9ba7f4d
27 changed files with 3573 additions and 17 deletions
|
|
@ -32,12 +32,32 @@ public class NetworkProtocolTests
|
|||
Assert.Equal("TestServer", sync.ServerName);
|
||||
Assert.Equal("Welcome MOTD", sync.Motd);
|
||||
Assert.NotNull(sync.Screens);
|
||||
Assert.Equal(4, sync.Screens.Count);
|
||||
Assert.Equal(5, sync.Screens.Count);
|
||||
|
||||
Assert.Contains(sync.Screens, s => s.ScreenId == "F1_Chat");
|
||||
Assert.Contains(sync.Screens, s => s.ScreenId == "F2_Channels");
|
||||
Assert.Contains(sync.Screens, s => s.ScreenId == "F3_Users");
|
||||
Assert.Contains(sync.Screens, s => s.ScreenId == "F4_Files");
|
||||
Assert.Contains(sync.Screens, s => s.ScreenId == "F5_Inbox");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void NetworkEnvelope_ShouldPackAndUnpackInboxPackets()
|
||||
{
|
||||
var actionPacket = new InboxActionPacket
|
||||
{
|
||||
Action = "mark_read",
|
||||
ItemId = "item_123",
|
||||
ChannelId = "ch_general"
|
||||
};
|
||||
|
||||
var env = NetworkEnvelope.Create(MessageTypes.InboxAction, actionPacket);
|
||||
var unpacked = env.Unpack<InboxActionPacket>();
|
||||
|
||||
Assert.NotNull(unpacked);
|
||||
Assert.Equal("mark_read", unpacked.Action);
|
||||
Assert.Equal("item_123", unpacked.ItemId);
|
||||
Assert.Equal("ch_general", unpacked.ChannelId);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue