コード例 #1
0
ファイル: CreatorTest.cs プロジェクト: pangsen/SharpRemote
        private T CreateServantAndProxy <T>(T subject)
        {
            var objectId = (ulong)_random.Next();

            _servant = _servantCreator.CreateServant(_endPoint, _channel, objectId, subject);
            return(_proxyCreator.CreateProxy <T>(_endPoint, _channel, objectId));
        }
コード例 #2
0
        private T TestGenerate <T>()
        {
            Type type = null;

            new Action(() => type = _creator.GenerateProxy <T>())
            .ShouldNotThrow();

            type.Should().NotBeNull();

            _objectId = (ulong)_random.Next();
            var obj   = _creator.CreateProxy <T>(_endPoint.Object, _channel.Object, _objectId);
            var proxy = obj as IProxy;

            proxy.Should().NotBeNull();
            proxy.ObjectId.Should().Be(_objectId);

            return(obj);
        }
コード例 #3
0
 /// <inheritdoc />
 public T CreateProxy <T>(IRemotingEndPoint endPoint, IEndPointChannel channel, ulong objectId)
 {
     return(_proxyCreator.CreateProxy <T>(endPoint, channel, objectId));
 }