public void GetProxyObject_TypeWithProperty_CreatesCorrectTypeDefinition() { var mock = new Mock <IRpcChannel>(); var proxy = new RpcObjectRepository(false).GetProxyObject <IProperty>(mock.Object, 0); Assert.IsNotNull(proxy.GetType().GetProperty(nameof(IProperty.TestProperty))); }
public void GetProxyObject_SimpleType_Succeeds() { var mock = new Mock <IRpcChannel>(); var proxy = new RpcObjectRepository(false).GetProxyObject <ISimple1>(mock.Object, 0); proxy.Test(); mock.Verify(c => c.CallRpcMethod(0, "Test", new Type[0], new object[0], typeof(void))); }
public void GetProxyObject_TypeWithEvent_Succeeds() { var mock = new Mock <IRpcChannel>(); var proxy = new RpcObjectRepository(false).GetProxyObject <ISimpleEvent>(mock.Object, 0); proxy.TestEvent += (s, e) => { }; }
public void GetProxyObject_SimpleType_Succeeds2() { var mock = new Mock <IRpcChannel>(); mock.Setup(p => p.CallRpcMethod(0, "Test2", new Type[] { typeof(int), typeof(string) }, new object[] { 1, "a" }, typeof(int))).Returns(2); var proxy = new RpcObjectRepository(false).GetProxyObject <ISimple2>(mock.Object, 0); proxy.Test(); mock.Verify(c => c.CallRpcMethod(0, "Test", new Type[0], new object[0], typeof(void))); proxy.Test2(1, "a"); mock.Verify(c => c.CallRpcMethod(0, "Test2", new Type[] { typeof(int), typeof(string) }, new object[] { 1, "a" }, typeof(int))); }