public void replicated_to_should_be_sent_to_subscriptions() { AssertEx.IsOrBecomesTrue(() => TcpSends.Count > 4, msg: "TcpSend msg not recieved"); var sends = TcpSends.Where(tcpSend => tcpSend.Message is ReplicationTrackingMessage.ReplicatedTo).ToList(); Assert.AreEqual(3, sends.Count); Assert.IsTrue(sends.Any(msg => msg.ConnectionManager.ConnectionId == ReplicaSubscriptionId)); Assert.IsTrue(sends.Any(msg => msg.ConnectionManager.ConnectionId == ReplicaSubscriptionId2)); Assert.IsTrue(sends.Any(msg => msg.ConnectionManager.ConnectionId == ReadOnlyReplicaSubscriptionId)); }
public void replicated_to_should_be_sent_to_subscriptions() { AssertEx.IsOrBecomesTrue(() => TcpSends.Count > 4, msg: "TcpSend msg not recieved"); var sends = TcpSends.Where(tcpSend => tcpSend.Message is ReplicationTrackingMessage.ReplicatedTo).ToList(); Assert.AreEqual(3 * 2, sends.Count); //one ReplicatedTo message in sent when the subscription is added and the second one in When() Assert.AreEqual(2, sends.Count(msg => msg.ConnectionManager.ConnectionId == ReplicaSubscriptionId)); Assert.AreEqual(2, sends.Count(msg => msg.ConnectionManager.ConnectionId == ReplicaSubscriptionId2)); Assert.AreEqual(2, sends.Count(msg => msg.ConnectionManager.ConnectionId == ReadOnlyReplicaSubscriptionId)); }