Пример #1
0
        /// <summary>
        /// Creates a new <see cref="CustomClientMock"/> instance.
        /// </summary>
        public CustomClientMock()
            : base(null)
        {
            this.SocketMock = new NetSocketMock();

            this.SetupGet(x => x.Socket).Returns(this.SocketMock);
        }
Пример #2
0
        public NetClientTests()
        {
            var configuration = new NetClientConfiguration("127.0.0.1", 4444);

            _socketMock = new NetSocketMock();
            _client     = new Mock <NetClient>(configuration);
            _client.SetupGet(x => x.Socket).Returns(_socketMock);
        }
Пример #3
0
        public NetServerTests()
        {
            _socketMock = new NetSocketMock();
            _socketMock.ConfigureAcceptResult(true);

            _serverConfiguration = new NetServerConfiguration("127.0.0.1", 4444);

            _server = new NetServerMock <CustomClient>(_serverConfiguration);
            _server.SetupGet(x => x.Socket).Returns(_socketMock);
        }
Пример #4
0
        public NetAcceptorTests()
        {
            _serverSocket = new NetSocketMock();
            _acceptedSocket = new NetSocketMock();
            _serverConfiguration = new NetServerConfiguration("127.0.0.1", 4444);
            _server = new NetServerMock<CustomClient>(_serverConfiguration);
            _serverAcceptor = new NetServerAcceptor(_server.Object);

            _server.SetupGet(x => x.Socket).Returns(_serverSocket);
        }