public async void ArrayData_ToArrayAsync_ThrowsAggregateExceptions() { var testData = new ArrayData_ThrowNonAsync(new byte[0]); Assert.Equal("Mock Exception", (await Assert.ThrowsAsync <InvalidOperationException>(async() => await testData.ToArrayAsync())) .Message); }
public void ArrayData_ToArrayAsync_ThrowsAggregateExceptions() { var testData = new ArrayData_ThrowNonAsync(new byte[0]); Assert.Equal("Mock Exception", Assert.IsType <InvalidOperationException>( Assert.Single( Assert.Throws <AggregateException>(() => testData.ToArrayAsync().Result) .InnerExceptions)) .Message); }