public void SerialiseDummyEventToExpectedFormat() { var dummyEvent = this.GetDummyEvent(); string expectedMessage = @"content-type:application/vnd.meungblut.websockets.dummyevent+json {""id"":""6a8d7bcb-4d16-4b22-af52-60be3860ab86"",""someData"":""some data""}"; var serialiser = new WebSocketDataSerialisation(); var serialisedMessage = serialiser.GetString(dummyEvent); Assert.AreEqual(expectedMessage, serialisedMessage); }
public void SendMessage(string webSocketId, IDomainEvent domainEvent) { var serialiser = new WebSocketDataSerialisation(); this.managers[webSocketId].BroadcastToAllClients(serialiser.GetString(domainEvent)); }
public static void SendMessage(IDomainEvent domainEvent) { var serialiser = new WebSocketDataSerialisation(); superWebsocketManager.BroadcastToAllClients(serialiser.GetString(domainEvent)); }