public void TestDynamicInvocation_Success() { string arg = Guid.NewGuid().ToString(); int messageId = Environment.TickCount % 1000; string methodName = "SomeMethod"; using ( var environment = new InProcTestEnvironment( ( method, id, args ) => method == methodName && args[ 0 ].AsString() == arg ) ) using ( dynamic target = new DynamicRpcProxy( environment.EndPoint, environment.Configuration ) ) { MessagePackObject result = target.SomeMethod( arg ); Assert.That( result == true ); } }
public void TestDynamicInvocation_Success() { string arg = Guid.NewGuid().ToString(); int messageId = Environment.TickCount % 1000; string methodName = "SomeMethod"; using (var environment = new InProcTestEnvironment((method, id, args) => method == methodName && args[0].AsString() == arg)) using (dynamic target = new DynamicRpcProxy(environment.EndPoint, environment.Configuration)) { MessagePackObject result = target.SomeMethod(arg); Assert.That(result == true); } }
public void TestDynamicInvocation_ServerError() { using (var environment = new InProcTestEnvironment((method, id, args) => { throw new InvalidOperationException("DUMMY"); })) using (dynamic target = new DynamicRpcProxy(environment.EndPoint, environment.Configuration)) { try { target.SomeMethod(); Assert.Fail(); } catch (RpcMethodInvocationException ex) { Assert.That(ex.MethodName, Is.StringContaining("SomeMethod")); Assert.That(ex.Message, Is.StringContaining("DUMMY")); } } }
public void TestDynamicInvocation_ServerError() { using ( var environment = new InProcTestEnvironment( ( method, id, args ) => { throw new InvalidOperationException( "DUMMY" ); } ) ) using ( dynamic target = new DynamicRpcProxy( environment.EndPoint, environment.Configuration ) ) { try { target.SomeMethod(); Assert.Fail(); } catch ( RpcMethodInvocationException ex ) { Assert.That( ex.MethodName, Is.StringContaining( "SomeMethod" ) ); Assert.That( ex.Message, Is.StringContaining( "DUMMY" ) ); } } }