public void RegisterMessageSource(string address) { var messageSource = new TestMessageSource(); containerHost.RegisterMessageSource(address, messageSource); messageSources.Add(address, messageSource); }
public void SendMessage(string address, string payload) { if (messageSources.TryGetValue(address, out var messageSource)) { messageSource.SendMessage(payload); } else { messageSource = new TestMessageSource(); messageSource.SendMessage(payload); containerHost.RegisterMessageSource(address, messageSource); messageSources.Add(address, messageSource); } }