Messages published with the PublishAsync method are published twice to all subscribes. In addition to this, the callback to indicated that publishing is finished is never invoked. This bug is intruduced by "Add dotnet core test app #132" where the publish mechanism was changed to support .netcore. Both bugs can be checked with the this unit test:
[TestMethod]
public void PublishAsync_Callback_EventOnce()
{
var syncRoot = new object();
var messageCount = 0;
var callbackEvent = new ManualResetEvent(false);
var messenger = UtilityMethods.GetMessenger();
messenger.Subscribe<TestMessage>(m => { lock (syncRoot) messageCount++; });
var message = new TestMessage(this);
messenger.PublishAsync<TestMessage>(message, ar => callbackEvent.Set());
Assert.IsTrue(callbackEvent.WaitOne(1000));
Assert.AreEqual(1, messageCount);
}
Messages published with the
PublishAsync
method are published twice to all subscribes. In addition to this, the callback to indicated that publishing is finished is never invoked. This bug is intruduced by "Add dotnet core test app #132" where the publish mechanism was changed to support .netcore. Both bugs can be checked with the this unit test: