public override async Task OnDisconnected(bool stopCalled)
        {
            string connectionId = Context.ConnectionId;

            Logger.Debug("OnDisconnected for {connectionId}", connectionId);

            await _connectionsManager.RemoveAllBuildConfigs(connectionId);

            await base.OnDisconnected(stopCalled);
        }
예제 #2
0
        public async Task OnDisconnected_RemovesUserBuilds()
        {
            string username     = _fixture.Create <string>();
            string connectionId = _fixture.Create <string>();

            A.CallTo(() => _principal.Identity.Name).Returns(username);
            A.CallTo(() => _context.ConnectionId).Returns(connectionId);
            A.CallTo(() => _context.User).Returns(_principal);

            CiDashboardHub hub = new CiDashboardHub(_connectionsManager, _commandProcessor, _infoQuery, _refreshInfo)
            {
                Context = _context
            };

            await hub.OnDisconnected(true);

            A.CallTo(() => _connectionsManager.RemoveAllBuildConfigs(connectionId))
            .MustHaveHappened();
        }