public async Task Should_unsubscribe_admin_from_all_conferences() { var numOfConferences = 10; var conferences = SetupAdminConferences(numOfConferences); var conferenceIds = conferences.Select(c => c.Id.ToString()).ToArray(); await Hub.OnDisconnectedAsync(null); GroupManagerMock.Verify( x => x.RemoveFromGroupAsync(HubCallerContextMock.Object.ConnectionId, It.IsIn(conferenceIds), CancellationToken.None), Times.Exactly(numOfConferences)); }
public async Task Should_not_unsubscribe_judge_from_conference_channels() { const int numOfConferences = 10; const int numOfConferencesWithUser = 2; var conferenceIds = SetupJudgeConferences(numOfConferences, numOfConferencesWithUser); await Hub.OnDisconnectedAsync(null); GroupManagerMock.Verify( x => x.RemoveFromGroupAsync(HubCallerContextMock.Object.ConnectionId, It.IsIn(conferenceIds), CancellationToken.None), Times.Never); }
public async Task Should_subscribe_admin_to_vho_group() { var numOfConferences = 10; SetupAdminConferences(numOfConferences); await Hub.OnConnectedAsync(); GroupManagerMock.Verify( x => x.AddToGroupAsync(HubCallerContextMock.Object.ConnectionId, EventHub.Hub.EventHub.VhOfficersGroupName, CancellationToken.None), Times.Once); }
public async Task Should_unsubscribe_user_from_own_user_group() { const int numOfConferences = 10; const int numOfConferencesWithUser = 2; SetupJudgeConferences(numOfConferences, numOfConferencesWithUser); await Hub.OnDisconnectedAsync(null); GroupManagerMock.Verify( x => x.RemoveFromGroupAsync(HubCallerContextMock.Object.ConnectionId, Claims.Identity.Name, CancellationToken.None), Times.Once); }