public async Task Should_send_request() { var context = await this.SetupContext(); var subject = new RoomNotificationHandler( context, this.mediator.Object, this.messageFactory.Object, this.connectionIdStore.Object); var notification = new RoomNotification(GameId); await subject.Handle(notification, default); var playerIds = new[] { HostConnectionId, ChallengerConnectionId }; this.mediator.Verify(x => x.Send( It.Is <HubGroupNotify.Request>( y => y.Group == GameId.ToString() && y.Message == Message && new HashSet <string>(y.Excluded).SetEquals(playerIds)), It.IsAny <CancellationToken>())); }
public async Task Should_get_message_with_correct_parameters() { var context = await this.SetupContext(); var subject = new RoomNotificationHandler( context, this.mediator.Object, this.messageFactory.Object, this.connectionIdStore.Object); var notification = new RoomNotification(GameId); await subject.Handle(notification, default); this.messageFactory.Verify(x => x.Create( It.Is <Messages.GameState.MessageData>( y => y.GameId == GameId && !y.PlayerId.HasValue))); }