Exemplo n.º 1
0
        public async Task HubShouldSendUpdatedWeatherForZipCode()
        {
            var connection = await StartHubConnection();

            await connection.Invoke <WeatherDto>("get", "50035");

            var tcs = new TaskCompletionSource <WeatherDto>();

            connection.On("update", new[] { typeof(WeatherDto) }, dto => tcs.SetResult(dto[0] as WeatherDto));

            await _actionSource.Dispatch(new TimerElapsedAction());

            var weatherDto = await tcs.Task;

            Assert.IsNotNull(weatherDto);
        }
Exemplo n.º 2
0
 public Task Invoke(HttpContext context)
 {
     _actionSource.Dispatch(new HttpRequestAction(context.Request));
     return(this._next(context));
 }