public void TestTypeRegistrationExplicit() { using (new AssertionScope()) using (var listener = new JsonRpcServer(new MockService())) { listener.Register(typeof(RpcTargetMock), "Canary"); listener.Register(typeof(RpcTargetMock), "Echo", "Pizza"); var registry = listener.GetRegisteredMethods(); registry.Should().Contain("Canary"); registry.Should().Contain("Pizza"); // ReSharper disable once AccessToDisposedClosure Action testAction = () => listener.Register(typeof(RpcTargetMock), "thisIsNotAValidMethod"); testAction.Should().Throw <RpcRegistrationException>(); } }
public TestRpcClient() { var glue = new MockService(); var listener = new JsonRpcServer(glue); listener.Register <RpcTargetMock>(); listener.Start(); _client = new JsonRpcClient(glue); }
public void TestTypeRegistration() { using (new AssertionScope()) using (var listener = new JsonRpcServer(new MockService())) { listener.Register(typeof(RpcTargetMock)); var registry = listener.GetRegisteredMethods(); registry.Should().Contain("Canary"); } }