コード例 #1
0
ファイル: CommunicationTests.cs プロジェクト: jaskie/jNet.RPC
        public async static Task SetUpServerClient(TestContext context)
        {
            _mockObject = new Tests.ServerLibrary.MockRoot();

            _server = new ServerHost(1100, _mockObject);
            _server.Start();

            _client = new RemoteClient();
            await _client.ConnectAsync("127.0.0.1:1100");
        }
コード例 #2
0
        public void ResolveProxyTypesLocal_ProxyObjectBase(ServerHost server, RemoteClient client, Type expectedType)
        {
            server.Start();
            client.ConnectAsync($"127.0.0.1:{server.ListenPort}").Wait();

            var proxy = client.GetRootObject <IMockRoot>();

            server.Dispose();
            client.Dispose();

            Assert.IsNotNull(proxy, "GetRootObject returned null!");
            Assert.IsTrue(proxy.GetType() == expectedType, $"Returned type not expected! {proxy} : {expectedType}");
        }