public void StationBoard()
        {
            testee = new TransportHandler();
            var stationBoard = testee.GetStationBoard("Sursee", "8502007");

            Assert.IsNotNull(stationBoard);
        }
        public void Connections()
        {
            testee = new TransportHandler();
            var connections = testee.GetConnections("Sursee", "Luzern", 4);

            Assert.IsNotNull(connections);
        }
        public void Locations()
        {
            testee = new TransportHandler();
            var stations = testee.GetStations("Sursee,");

            Assert.AreEqual(10, stations.StationList.Count);
        }
Esempio n. 4
0
 public SimpleServiceHandler(ITransportHandler transportHandler)
 {
     _transportHandler           = transportHandler;
     _fileDownloadCommandHandler = new FileDownloadCommandHandler(_transportHandler);
     _uploadFileCommandHandler   = new UploadFileCommandHandler(_transportHandler);
     _timeCommandHandler         = new TimeCommandHandler(_transportHandler);
     _echoCommandHandler         = new EchoCommandHandler(_transportHandler);
 }
Esempio n. 5
0
        public async Task AcceptConnection(ITransportHandler networkTransportHandler)
        {
            var acceptedSocket = await _acceptorListener.AcceptSocketAsync();

            _socketOptionsAccessorFactory
            .GetSocketOptionsAccessor()
            .SetOptions(acceptedSocket);

            networkTransportHandler.Activate(acceptedSocket);
        }
        public async Task HandleNewConnection(ITransportHandler transportHandler)
        {
            var welcomeMessage = await ReceiveMessage(transportHandler);

            if (_sessionContexts.TryGetValue(welcomeMessage.ClientId, out var sessionContext))
            {
            }
            else
            {
                var initializeContext = InitializeContext(
                    welcomeMessage.ClientId,
                    welcomeMessage.MessageOptions);

                _sessionContexts.Add(welcomeMessage.ClientId, initializeContext);
            }
        }
Esempio n. 7
0
 public TimeCommandHandler(ITransportHandler transportHandler)
 {
     _transportHandler = transportHandler;
 }
Esempio n. 8
0
 public UploadFileCommandHandler(ITransportHandler transportHandler)
 {
     _transportHandler = transportHandler;
 }
Esempio n. 9
0
 public async Task HandleNewConnection(ITransportHandler transportHandler)
 {
     await(new SimpleServiceHandler(transportHandler)).StartReceive();
 }
 public FileDownloadCommandHandler(ITransportHandler transportHandler)
 {
     _transportHandler = transportHandler;
 }
 private async Task <WelcomeMessage> ReceiveMessage(ITransportHandler transportHandler)
 {
     return(_byteSerializer.Deserialize <WelcomeMessage>(await transportHandler.ReceiveAllAvailable()));
 }
Esempio n. 12
0
 public EchoCommandHandler(ITransportHandler transportHandler)
 {
     _transportHandler = transportHandler;
 }