public void DeleteMessage_WhenCalled_CannotGetDeletedMessage() { const string channelName = "channel-01"; const string channelEvent = "event-01"; const string message = "hello world"; var actualMessage = string.Empty; var inMemoryLiteMessageBusService = new InMemoryLiteMessageBusService(); inMemoryLiteMessageBusService.AddMessage(channelName, channelEvent, message); // Delete the message. inMemoryLiteMessageBusService.DeleteMessage(channelName, channelEvent); // Hook to the message channel. var hooker = inMemoryLiteMessageBusService.HookMessageChannel <string>(channelName, channelEvent); hooker.Subscribe(m => actualMessage = m); Assert.That(actualMessage, Is.Not.EqualTo(message).After(2000, 500)); }
public void DeleteMessage_WhenCalled_CannotSubscribeToDeletedMessageChannel() { const string channelName = "channel-01"; const string channelEvent = "event-01"; const string message = "hello world"; var hasChannelSubscribed = false; var inMemoryLiteMessageBusService = new InMemoryLiteMessageBusService(); inMemoryLiteMessageBusService.AddMessage(channelName, channelEvent, message); // Delete the message. inMemoryLiteMessageBusService.DeleteMessage(channelName, channelEvent); // Hook to the message channel. var hooker = inMemoryLiteMessageBusService.HookMessageChannel <string>(channelName, channelEvent); hooker.Subscribe(_ => hasChannelSubscribed = true); Assert.That(hasChannelSubscribed, Is.Not.True.After(2000, 500)); }