// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
using System.Threading.Tasks;
namespace CommunityToolkit.Mvvm.UnitTests.Helpers;
///
/// A helper class to validate scenarios related to .
///
internal static class TaskSchedulerTestHelper
{
///
/// A custom for callbacks to .
///
/// An instance that throws a test exception to track.
/// An that signals whenever the test has completed.
public delegate void TestCallback(Action throwAction, Action completeAction);
///
/// Checks whether a given test exception is correctly bubbled up to .
///
/// The instance to use to run the test.
/// Whether or not the test exception was correctly bubbled up to .
public static async Task IsExceptionBubbledUpToUnobservedTaskExceptionAsync(TestCallback callback)
{
TaskCompletionSource