| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- // Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.
- using System;
- using System.Text;
- using System.Collections.Generic;
- using System.Linq;
- using Xunit;
- namespace Tests
- {
-
- public partial class Tests
- {
- public void AssertThrows<E>(Action a)
- where E : Exception
- {
- Assert.Throws<E>(a);
- }
- public void AssertThrows<E>(Action a, Func<E, bool> assert)
- where E : Exception
- {
- try
- {
- a();
- Assert.True(false);
- }
- catch (E e)
- {
- Assert.True(assert(e));
- }
- }
- public void NoNext<T>(IEnumerator<T> e)
- {
- Assert.False(e.MoveNext());
- }
- public void HasNext<T>(IEnumerator<T> e, T value)
- {
- Assert.True(e.MoveNext());
- Assert.Equal(value, e.Current);
- }
- }
- }
|