Beispiel #1
0
        public void RegisterDialogSubmissionHandler_HandleCancellations()
        {
            // Arrange
            var handler           = Substitute.For <IDialogSubmissionHandler>();
            var otherDialogCancel = new DialogCancellation {
                CallbackId = "other"
            };
            var dialogCancel = new DialogCancellation {
                CallbackId = "key"
            };

            var sut = Configure(c => c.RegisterDialogSubmissionHandler("key", handler));

            // Act
            HandleLegacyDialogCancellations(sut, new[] { otherDialogCancel, dialogCancel });

            // Assert
            handler.DidNotReceive().HandleCancel(otherDialogCancel);
            handler.Received().HandleCancel(dialogCancel);
        }
        private async Task <HttpResponse> HandleDialogCancellation(HttpContext context, DialogCancellation dialogCancellation)
        {
            await _dialogSubmissionHandler.HandleCancel(dialogCancellation).ConfigureAwait(false);

            return(await context.Respond(HttpStatusCode.OK).ConfigureAwait(false));
        }
Beispiel #3
0
        private async Task <SlackResult> HandleDialogCancellation(DialogCancellation dialogCancellation)
        {
            await _dialogSubmissionHandler.HandleCancel(dialogCancellation).ConfigureAwait(false);

            return(new EmptyResult(HttpStatusCode.OK));
        }
Beispiel #4
0
 public Task HandleCancel(DialogCancellation cancellation)
 {
     return(Task.CompletedTask);
 }
 public Task HandleCancel(DialogCancellation cancellation) => ResolvedHandle(h => h.HandleCancel(cancellation));
Beispiel #6
0
 public async Task HandleCancel(DialogCancellation cancellation)
 {
 }
 public Task HandleCancel(DialogCancellation cancellation) => Task.CompletedTask;