public async void FirstAsync_With_Empty_Must_Return_None(int[] source) { // Arrange var wrapped = Wrap .AsAsyncValueEnumerable(source); // Act var result = await AsyncValueEnumerableExtensions .FirstAsync <Wrap.AsyncValueEnumerableWrapper <int>, Wrap.AsyncEnumerator <int>, int>(wrapped); // Assert _ = result.Must() .BeOfType <Option <int> >() .EvaluateTrue(option => option.IsNone); }
public async ValueTask FirstAsync_With_ValidData_Must_Return_Some(int[] source) { // Arrange var wrapped = Wrap .AsAsyncValueEnumerable(source); var expected = Enumerable .First(source); // Act var result = await AsyncValueEnumerableExtensions .FirstAsync <Wrap.AsyncValueEnumerableWrapper <int>, Wrap.AsyncEnumerator <int>, int>(wrapped); // Assert _ = result.Match( value => value.Must().BeEqualTo(expected), () => throw new Exception()); }