public void TryCreateWaitDialog_Success()
        {
            // Arrange
            var vsWaitDialogFactory = CreateVSWaitDialogFactory();
            var waitDialogFactory   = new DefaultWaitDialogFactory(JoinableTaskContext, vsWaitDialogFactory);

            // Act
            var result = waitDialogFactory.TryCreateWaitDialog(title: null, message: null, async(context) =>
            {
                await Task.Delay(10, context.CancellationToken);
                return(1234);
            });

            // Assert
            Assert.False(result.Cancelled);
            Assert.Equal(1234, result.Result);
        }
        public void TryCreateWaitDialog_Cancelled()
        {
            // Arrange
            var dialog = new TestThreadedWaitDialog();
            var vsWaitDialogFactory = CreateVSWaitDialogFactory(dialog);
            var waitDialogFactory   = new DefaultWaitDialogFactory(JoinableTaskContext, vsWaitDialogFactory);

            // Act
            var result = waitDialogFactory.TryCreateWaitDialog(title: null, message: null, async(context) =>
            {
                await Task.Delay(10, context.CancellationToken);

                dialog.Cancel();

                await Task.Delay(10000, context.CancellationToken);
                return(true);
            });

            // Assert
            Assert.True(result.Cancelled);
            Assert.False(result.Result);
        }