// 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 System.Text; using System.Collections.Generic; using System.Linq; using Xunit; namespace Tests { public partial class Tests { public void AssertThrows(Action a) where E : Exception { Assert.Throws(a); } public void AssertThrows(Action a, Func assert) where E : Exception { try { a(); Assert.True(false); } catch (E e) { Assert.True(assert(e)); } } public void NoNext(IEnumerator e) { Assert.False(e.MoveNext()); } public void HasNext(IEnumerator e, T value) { Assert.True(e.MoveNext()); Assert.Equal(value, e.Current); } } }