TryReplicate() public method

public TryReplicate ( string aggregateId, int version, object e ) : bool
aggregateId string
version int
e object
return bool
        public void TryReplicate_Success_Test()
        {
            m_SiblingProxyMock.Setup(m => m.Open()).Verifiable("Server hasn't opened connections before replication");
            m_SiblingProxyMock.Setup(m => m.Push("a", 123, "b")).Verifiable("Server hasn't pushed data to siblings");

            var connectionManager = new ConnectionManager();
            connectionManager.OpenOutcomingConnections();
            Assert.IsTrue(connectionManager.TryReplicate("a", 123, "b"));

            m_SiblingProxyMock.Verify();
        }
        public void TryReplicate_ConnectionLost_Test()
        {
            //Assert.Fail("Change CommunicationException by some more generic");

            m_SiblingProxyMock.Setup(m => m.Open()).Verifiable("Server hasn't opened connections before replication");
            m_SiblingProxyMock.Setup(m => m.Push("a", 123, "b")).Throws(new ConnectionErrorException()); // it's the only place in assembly that requires ServiceModel lib

            var connectionManager = new ConnectionManager();
            var connectionLostFired = false;
            connectionManager.OnConnectionLoss += (id) => { connectionLostFired = true; };
            connectionManager.OpenOutcomingConnections();
            Assert.IsFalse(connectionManager.TryReplicate("a", 123, "b"));

            m_SiblingProxyMock.Verify();
            Assert.IsTrue(connectionLostFired);
        }
        public void TryReplicate_GeneralError_Test()
        {
            m_SiblingProxyMock.Setup(m => m.Open()).Verifiable("Server hasn't opened connections before replication");
            m_SiblingProxyMock.Setup(m => m.Push("a", 123, "b")).Throws(new Exception());

            var connectionManager = new ConnectionManager();
            var connectionLostFired = false;
            connectionManager.OnConnectionLoss += (id) => { connectionLostFired = true; };
            connectionManager.OpenOutcomingConnections();
            Assert.IsFalse(connectionManager.TryReplicate("a", 123, "b"));

            m_SiblingProxyMock.Verify();
            Assert.IsFalse(connectionLostFired);
        }