public void CallSynchronous_WhenCalledWithoutParams_SendsTcpMessageWithoutParams() { string result = ""; bool methodCalled = false; TestableCollabProxyClient theClient = new TestableCollabProxyClient(); // Register a listener on the TCP connection TestHelper.RegisterListener("randomness", val => { methodCalled = true; result = val; }); theClient.CallSynchronous("Randomness"); Assert.IsTrue(methodCalled); Assert.AreEqual("", result); }
public void CallSynchronous_WhenCalledWithParams_SendsTcpMessageWithParams() { string result = ""; bool methodCalled = false; TestableCollabProxyClient theClient = new TestableCollabProxyClient(); // Register a listener on the TCP connection TestHelper.RegisterListener("randomness", val => { methodCalled = true; result = val; }); theClient.CallSynchronous("Randomness", "foo", "bar"); Assert.IsTrue(methodCalled); Object[] objects = Serialization.Deserialize <Object[]>(result); Assert.AreEqual(objects[0], "foo"); Assert.AreEqual(objects[1], "bar"); }