// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the Apache 2.0 License. // See the LICENSE file in the project root for more information. using System; using Xunit; namespace Tests { public partial class AsyncTests { private const int WaitTimeoutMs = 5000; #pragma warning disable xUnit1013 // Public method should be marked as test public void AssertThrows(Action a) where E : Exception { Assert.Throws(a); } public void AssertThrows(Action a, Func assert) where E : Exception { var hasFailed = false; try { a(); } catch (E e) { Assert.True(assert(e)); hasFailed = true; } if (!hasFailed) { Assert.True(false); } } #pragma warning restore xUnit1013 // Public method should be marked as test } }